제출 #120009

#제출 시각아이디문제언어결과실행 시간메모리
120009nxteru동굴 (IOI13_cave)C++14
0 / 100
7 ms512 KiB
#include "cave.h" #include <bits/stdc++.h> using namespace std; #define PB push_back int n,ans[5005],k,s[5005]; void exploreCave(int N) { n=N; while(1){ vector<int>x; for(int i=0;i<n;i++)if(ans[i]==-1)x.PB(i); if(x.size()==0)break; int p=tryCombination(s); if(p==-1||p>k)p=1; else p=0; while(x.size()>1){ for(int i=0;i<x.size()/2;i++)s[x[i]]^=1; int q=tryCombination(s); if(q==-1||q>k)q=1; else q=0; vector<int>y; if(p==q)for(int i=x.size()/2;i<x.size();i++)y.PB(x[i]); else for(int i=0;i<x.size()/2;i++)y.PB(x[i]); x.clear(); for(int i=0;i<y.size();i++)x.PB(y[i]); p=q; } ans[x[0]]=k++; if(p==0)s[x[0]]^=1; } answer(s,ans); }

컴파일 시 표준 에러 (stderr) 메시지

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:16:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    for(int i=0;i<x.size()/2;i++)s[x[i]]^=1;
                ~^~~~~~~~~~~
cave.cpp:21:34: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    if(p==q)for(int i=x.size()/2;i<x.size();i++)y.PB(x[i]);
                                 ~^~~~~~~~~
cave.cpp:22:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    else for(int i=0;i<x.size()/2;i++)y.PB(x[i]);
                     ~^~~~~~~~~~~
cave.cpp:24:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    for(int i=0;i<y.size();i++)x.PB(y[i]);
                ~^~~~~~~~~
#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...