제출 #425604

#제출 시각아이디문제언어결과실행 시간메모리
425604ngraceUnscrambling a Messy Bug (IOI16_messy)C++14
38 / 100
2 ms332 KiB
#include "messy.h" #include <vector> #include <iostream> #include <utility> #include <algorithm> using namespace std; #define v vector #define pii pair<int,int> #define fi first #define se second std::vector<int> restore_permutation(int n, int w, int r) { for(int i=1;i<=n;i++){ string add; for(int j=0;j<i;j++) add.push_back('1'); while(add.size()!=n) add.push_back('0'); add_element(add); } compile_set(); v<int> perm(n,-1); for(int i=0;i<n;i++){ string base; for(int j=0;j<n;j++){ if(perm[j]==-1) base.push_back('0'); else base.push_back('1'); } for(int j=0;j<n;j++){ string check=base; if(check[j]=='0') check[j]='1'; else continue; if(check_element(check)){ perm[j]=i; break; } } } return perm; }

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

messy.cpp: In function 'std::vector<int> restore_permutation(int, int, int)':
messy.cpp:16:25: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   16 |         while(add.size()!=n) add.push_back('0');
      |               ~~~~~~~~~~^~~
#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...