Submission #110966

#TimeUsernameProblemLanguageResultExecution timeMemory
110966The_WolfpackCave (IOI13_cave)C++14
0 / 100
10 ms896 KiB
#include "cave.h" #include <bits/stdc++.h> using namespace std; int ans[5006]; int tmp[5006]; int doors[5006]; void exploreCave(int N) { memset(ans,sizeof(ans),-1); for(int i=0;i<N;i++) { for(int i1=0;i1<5005;i1++) tmp[i1]=0; for(int j=0;j<N;j++) if(ans[j]!=-1) tmp[j]=ans[j]; int sta=0; if(tryCombination(tmp)==i) sta=1; int koji; int L=0; int R=N-1; while(L<=R) { int mid=(L+R)/2; for(int j=L;j<=mid;j++) tmp[j]=sta; for(int j=mid+1;j<=R;j++) tmp[j]=1-sta; for(int j=0;j<N;j++) if(ans[j]!=-1) tmp[j]=ans[j]; if(tryCombination(tmp)==i) L=mid+1; else{R=mid;} } doors[L]=i; ans[L]=sta; } answer(ans,doors); }

Compilation message (stderr)

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:18:13: warning: unused variable 'koji' [-Wunused-variable]
         int koji;        
             ^~~~
In file included from /usr/include/string.h:635:0,
                 from /usr/include/c++/7/cstring:42,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:48,
                 from cave.cpp:2:
In function 'void* memset(void*, int, size_t)',
    inlined from 'void exploreCave(int)' at cave.cpp:11:11:
/usr/include/x86_64-linux-gnu/bits/string3.h:90:70: warning: 'void* __builtin___memset_chk(void*, int, long unsigned int, long unsigned int)': specified size 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
   return __builtin___memset_chk (__dest, __ch, __len, __bos0 (__dest));
                                                                      ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...