제출 #388894

#제출 시각아이디문제언어결과실행 시간메모리
388894jjang36524Unscrambling a Messy Bug (IOI16_messy)C++14
100 / 100
3 ms464 KiB
#include <vector> #include "messy.h" using namespace std; int N; void pus(int s,int e) { if(s+1==e) return; string st; int i; for(i=0;i<N;i++) { st.push_back('0'); } for(i=s;i<e;i++) { st[i]='1'; } for(i=s;i<(e+s)/2;i++) { st[i]='0'; add_element(st); st[i]='1'; } pus(s,(s+e)/2); pus((s+e)/2,e); } vector<int>an; void pus(int s,int e,vector<int>x) { if(s+1==e) { an[x[0]]=s; return; } string st; int i; for(i=0;i<N;i++) { st.push_back('0'); } for(i=0;i<x.size();i++) { st[x[i]]='1'; } vector<int>l; vector<int>r; for(i=0;i<x.size();i++) { st[x[i]]='0'; int a=check_element(st); if(a) l.push_back(x[i]); else r.push_back(x[i]); st[x[i]]='1'; } pus(s,(s+e)/2,l); pus((s+e)/2,e,r); } std::vector<int> restore_permutation(int n, int w, int r) { N=n; pus(0,N); compile_set(); vector<int>al; int i; for(i=0;i<n;i++) { an.push_back(0); al.push_back(i); } pus(0,N,al); return an; }

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

messy.cpp: In function 'void pus(int, int, std::vector<int>)':
messy.cpp:43:14: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   43 |     for(i=0;i<x.size();i++)
      |             ~^~~~~~~~~
messy.cpp:49:14: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   49 |     for(i=0;i<x.size();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...