제출 #1121802

#제출 시각아이디문제언어결과실행 시간메모리
1121802vjudge1Unscrambling a Messy Bug (IOI16_messy)C++17
20 / 100
2 ms336 KiB
// author - alimammadzade #include "messy.h" #include <bits/stdc++.h> using namespace std; vector<int> restore_permutation(int n, int w, int r) { vector<string> nums; vector<int> res(n); int query = 0; iota(res.begin(), res.end(), 0); string s = ""; for (int i = 0; i < n; i++) { s += "1"; string q; for (int j = 0; j < n - i - 1; j++) q += "0"; q += s; add_element(q); nums.push_back(q); } compile_set(); for (int i = 0; i < n; i++) for (int j = n - 1; j >= n - i - 1; j--) for (int k = 0; k < n - i - 1; k++) { string a = nums[i]; swap(a[j], a[k]); if (check_element(a)) { swap(res[j], res[k]); return res; } } return res; }

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

messy.cpp: In function 'std::vector<int> restore_permutation(int, int, int)':
messy.cpp:10:9: warning: unused variable 'query' [-Wunused-variable]
   10 |     int query = 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...