제출 #1247724

#제출 시각아이디문제언어결과실행 시간메모리
1247724m_bezrutchkaUnscrambling a Messy Bug (IOI16_messy)C++20
38 / 100
1 ms332 KiB
#include "messy.h" #include <bits/stdc++.h> using namespace std; mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); vector<int> restore_permutation(int n, int w, int r) { string s = ""; for (int i = 0; i < n; i++) { s.push_back('0'); } for (int i = 0; i < n; i++) { s[i] = '1'; add_element(s); } compile_set(); for (int i = 0; i < n; i++) { s[i] = '0'; } vector<int> p(n); for (int i = 0; i < n; i++) { vector<int> to_test; for (int j = 0; j < n; j++) { if (s[j] == '1') continue; to_test.push_back(j); } shuffle(to_test.begin(), to_test.end(), rng); for (int j: to_test) { s[j] = '1'; bool found = check_element(s); if (found) { p[j] = i; break; } s[j] = '0'; } } return p; }

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

messy.h:1:9: warning: #pragma once in main file
    1 | #pragma once
      |         ^~~~
messy_c.h:1:9: warning: #pragma once in main file
    1 | #pragma once
      |         ^~~~
#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...