Submission #992226
Source Code Expand
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.IO; using System.Globalization; using static System.Console; using Pair = System.Collections.Generic.KeyValuePair<int, int>; class Program { static void Main() { var sw = new StreamWriter(OpenStandardOutput()) { AutoFlush = false }; SetOut(sw); new Program().solve(); Out.Flush(); } Scanner cin = new Scanner(); readonly int[] dd = { 0, 1, 0, -1, 0 }; readonly int mod = 1000000007; readonly string alfa = "abcdefghijklmnopqrstuvwxyz"; int N; void solve() { N = cin.nextint; int k = 1; int cnt = 0; if (N == 1) { WriteLine(1); return; } if (N == 2) { WriteLine(2); return; } while (k < N) { k *= 2; cnt++; } int m = 1; for (int i = 0; i < cnt; i++) { WriteLine(m); m *= 2; } if (N - k > 0) { WriteLine(N - k); } } } class Scanner { string[] s; int i; char[] cs = new char[] { ' ' }; public Scanner() { s = new string[0]; i = 0; } public string[] scan { get { return ReadLine().Split(); } } public int[] scanint { get { return Array.ConvertAll(scan, int.Parse); } } public long[] scanlong { get { return Array.ConvertAll(scan, long.Parse); } } public double[] scandouble { get { return Array.ConvertAll(scan, double.Parse); } } public string next { get { if (i < s.Length) return s[i++]; string st = ReadLine(); while (st == "") st = ReadLine(); s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries); i = 0; return next; } } public int nextint { get { return int.Parse(next); } } public long nextlong { get { return long.Parse(next); } } public double nextdouble { get { return double.Parse(next); } } }
Submission Info
Submission Time | |
---|---|
Task | B - Exactly N points |
User | claw88 |
Language | C# (Mono 4.6.2.0) |
Score | 0 |
Code Size | 2181 Byte |
Status | WA |
Exec Time | 18 ms |
Memory | 2648 KB |
Judge Result
Set Name | sample | dataset1 | dataset2 | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 200 | 0 / 100 | ||||||||||||
Status |
|
|
|
Set Name | Test Cases |
---|---|
sample | sample-01.txt, sample-02.txt, sample-03.txt |
dataset1 | sample-01.txt, sample-02.txt, sample-03.txt, 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, 01-05.txt, 01-06.txt, 01-07.txt, 01-08.txt, 01-09.txt, 01-10.txt |
dataset2 | sample-01.txt, sample-02.txt, sample-03.txt, 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, 01-05.txt, 01-06.txt, 01-07.txt, 01-08.txt, 01-09.txt, 01-10.txt, 02-01.txt, 02-02.txt, 02-03.txt, 02-04.txt, 02-05.txt, 02-06.txt, 02-07.txt, 02-08.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
01-01.txt | AC | 18 ms | 2648 KB |
01-02.txt | AC | 17 ms | 2648 KB |
01-03.txt | WA | 17 ms | 2648 KB |
01-04.txt | WA | 17 ms | 2648 KB |
01-05.txt | WA | 17 ms | 2648 KB |
01-06.txt | WA | 17 ms | 2648 KB |
01-07.txt | WA | 18 ms | 2648 KB |
01-08.txt | WA | 17 ms | 2648 KB |
01-09.txt | WA | 17 ms | 2648 KB |
01-10.txt | WA | 17 ms | 2648 KB |
02-01.txt | WA | 17 ms | 2648 KB |
02-02.txt | WA | 17 ms | 2648 KB |
02-03.txt | WA | 17 ms | 2648 KB |
02-04.txt | WA | 17 ms | 2648 KB |
02-05.txt | WA | 18 ms | 2648 KB |
02-06.txt | WA | 17 ms | 2648 KB |
02-07.txt | WA | 17 ms | 2648 KB |
02-08.txt | WA | 17 ms | 2648 KB |
sample-01.txt | WA | 17 ms | 2648 KB |
sample-02.txt | AC | 18 ms | 2648 KB |
sample-03.txt | AC | 18 ms | 2648 KB |