제출 #796996

#제출 시각아이디문제언어결과실행 시간메모리
796996ShithilaUnscrambling a Messy Bug (IOI16_messy)C++14
38 / 100
1 ms340 KiB
#include <bits/stdc++.h> #include "messy.h" using namespace std; std::vector<int> restore_permutation(int n, int w, int r) { string x; string y; vector<int> ans; for(int i=0;i<n;i++) { x=x+'0'; } y=x; for(int i=0;i<n;i++) { x[i]='1'; add_element(x); } compile_set(); while(ans.size()!=n) { for(int i=0;i<n;i++) { bool valid=true; for(int j=0;j<ans.size();j++) { if(i==ans[j]) { valid=false; break; } } if(valid==false) continue; y[i]='1'; bool produced=check_element(y); if(produced==true) { ans.push_back(i); break; } else y[i]='0'; } } vector<int>pos(n); for (int i = 0;i<n;++i) pos[ans[i]] = i; return pos; }

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

messy.cpp: In function 'std::vector<int> restore_permutation(int, int, int)':
messy.cpp:20:21: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   20 |     while(ans.size()!=n)
      |           ~~~~~~~~~~^~~
messy.cpp:25:26: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   25 |             for(int j=0;j<ans.size();j++)
      |                         ~^~~~~~~~~~~
#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...