제출 #830283

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

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

messy.cpp: In function 'std::vector<int> restore_permutation(int, int, int)':
messy.cpp:8:12: warning: control reaches end of non-void function [-Wreturn-type]
    8 |     string s;
      |            ^
#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...