Submission #2948512
Source Code Expand
#include<bits/stdc++.h> using namespace std; typedef long long int LL; typedef LL ll; #define For(i,a,b) for (ll i=a;i<b;i++) #define ER(x) cout << #x << ' ' << x << endl #define smin(a,b) a=min(a,b) const ll M=200+5; ll st[M],stlen; ll f=0; void add(){ st[stlen++]=f; //st[stlen++]=f; } void calc(ll n){ //ER(n); //if (n<0) return; f++; add(); ll z=1; while (z<=n){ add(); ER(z); z*=2; z++; } z--; z/=2; //ER(z+z-z); //ER(n); n-=z; if (!n) return; calc(n); } int main(){ ios::sync_with_stdio(0); ll n; cin >> n; calc(n); cout << stlen << '\n'; For(i,0,stlen){ cout << st[i] << ' '; } }
Submission Info
Submission Time | |
---|---|
Task | A - Colorful MST |
User | vjudge3 |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 661 Byte |
Status | WA |
Exec Time | 1 ms |
Memory | 256 KB |
Judge Result
Set Name | Sample | Subtask1 | Subtask2 | Subtask3 | Subtask4 | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 100 | 0 / 100 | 0 / 200 | 0 / 300 | ||||||||||
Status |
|
|
|
|
|
Set Name | Test Cases |
---|---|
Sample | 00_example_01.txt, 00_example_02.txt, 00_example_03.txt, 00_example_04.txt |
Subtask1 | 00_example_03.txt, s1_01.txt, s1_02.txt, s1_03.txt, s1_04.txt, s1_05.txt, s1_06.txt |
Subtask2 | s1_01.txt, s1_02.txt, s1_03.txt, s1_04.txt, s1_05.txt, s1_06.txt, s2_07.txt, s2_08.txt, s2_09.txt, s2_10.txt, s2_11.txt, s2_12.txt |
Subtask3 | 00_example_02.txt, s3_13.txt, s3_14.txt, s3_15.txt, s3_16.txt, s3_17.txt, s3_18.txt |
Subtask4 | 00_example_01.txt, 00_example_02.txt, 00_example_03.txt, 00_example_04.txt, s1_01.txt, s1_02.txt, s1_03.txt, s1_04.txt, s1_05.txt, s1_06.txt, s2_07.txt, s2_08.txt, s2_09.txt, s2_10.txt, s2_11.txt, s2_12.txt, s3_13.txt, s3_14.txt, s3_15.txt, s3_16.txt, s3_17.txt, s3_18.txt, s4_19.txt, s4_20.txt, s4_21.txt, s4_22.txt, s4_23.txt, s4_24.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
00_example_01.txt | WA | 1 ms | 256 KB |
00_example_02.txt | WA | 1 ms | 256 KB |
00_example_03.txt | WA | 1 ms | 256 KB |
00_example_04.txt | WA | 1 ms | 256 KB |
s1_01.txt | WA | 1 ms | 256 KB |
s1_02.txt | WA | 1 ms | 256 KB |
s1_03.txt | WA | 1 ms | 256 KB |
s1_04.txt | WA | 1 ms | 256 KB |
s1_05.txt | WA | 1 ms | 256 KB |
s1_06.txt | WA | 1 ms | 256 KB |
s2_07.txt | WA | 1 ms | 256 KB |
s2_08.txt | WA | 1 ms | 256 KB |
s2_09.txt | WA | 1 ms | 256 KB |
s2_10.txt | WA | 1 ms | 256 KB |
s2_11.txt | WA | 1 ms | 256 KB |
s2_12.txt | WA | 1 ms | 256 KB |
s3_13.txt | WA | 1 ms | 256 KB |
s3_14.txt | WA | 1 ms | 256 KB |
s3_15.txt | WA | 1 ms | 256 KB |
s3_16.txt | WA | 1 ms | 256 KB |
s3_17.txt | WA | 1 ms | 256 KB |
s3_18.txt | WA | 1 ms | 256 KB |
s4_19.txt | WA | 1 ms | 256 KB |
s4_20.txt | WA | 1 ms | 256 KB |
s4_21.txt | WA | 1 ms | 256 KB |
s4_22.txt | WA | 1 ms | 256 KB |
s4_23.txt | WA | 1 ms | 256 KB |
s4_24.txt | WA | 1 ms | 256 KB |