제출 #794115

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

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

messy.cpp: In function 'std::vector<int> restore_permutation(int, int, int)':
messy.cpp:33:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   33 |     for(int i=0;i<s.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...