Submission #735450

#TimeUsernameProblemLanguageResultExecution timeMemory
735450keisuke6Fun Tour (APIO20_fun)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #define int long long signed main(){ int N; cin>>N; vector<int> A = {}; while(N > 2){ int d = 0; while((1<<(d+1)) <= N) d++; if(N+1-(1<<d) > (1<<(d-1))){ int s = (1<<d)+(1<<(d+1))-3; int c = 0; for(int i=(1<<d)-1;i<(1<<d)-1+(1<<(d-1));i++)if(s-i < N && i < s-i){ A.push_back(s-i); A.push_back(i); c += 2; } N -= c; continue; } if(N+1-(1<<d) > (1<<(d-1)-1)/2+1){ int s = (1<<d)+(1<<d)+(1<<(d-1))-3; int c = 0; for(int i=(1<<d)-1;i<=s-((1<<d)-1);i++)if(s-i < N && i < s-i){ A.push_back(i); A.push_back(s-i); c+=2; } N -= c; continue; } int c = 0; for(int i=(1<<d)-1;i<N;i++){ c += 2; A.push_back(i); A.push_back((1<<(d+1))-3-i); } N -= c; if(clock()*1.0/CLOCKS_PER_SEC > 1.6) break; } if(N == 2){ A.push_back(0); A.push_back(1); } if(N == 1) A.push_back(0); for(int x:A) cout<<x<<' '; cout<<endl; }

Compilation message (stderr)

fun.cpp: In function 'int main()':
fun.cpp:22:30: warning: suggest parentheses around '-' inside '<<' [-Wparentheses]
   22 |     if(N+1-(1<<d) > (1<<(d-1)-1)/2+1){
      |                         ~~~~~^~
/usr/bin/ld: /tmp/ccEE8v7t.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccvTzXXw.o:fun.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/ccEE8v7t.o: in function `main':
grader.cpp:(.text.startup+0x62a): undefined reference to `createFunTour(int, int)'
collect2: error: ld returned 1 exit status