제출 #1243265

#제출 시각아이디문제언어결과실행 시간메모리
1243265YassirSalamaUnscrambling a Messy Bug (IOI16_messy)C++20
20 / 100
1 ms328 KiB
#include <vector> #include "messy.h" #include<bits/stdc++.h> using namespace std; #define all(v) v.begin(),v.end() #define pb push_back std::vector<int> restore_permutation(int n, int w, int r) { auto f = [&](int i){ string s = string(n,'0'); for(int j = 0;j<=i;j++) s[j] = '1'; return s; }; for(int i = 0;i<n;i++){ add_element(f(i)); // cout<<i<<" "<<f(i)<<endl; } compile_set(); vector<int> p(n); for(int i = 0;i<n;i++){ for(int j = i+1;j<n;j++){ vector<int> p(n); for(int k = 0;k<n;k++){ p[k] = k; } swap(p[i],p[j]); //we have i<j //we need the string to be 111101110 //take the string with index j-1 string t = f(j-1); swap(t[i],t[j]); // cout<<"! "<<i<<" "<<j<<" "<<t<<endl; if(check_element(t)){ return p; } } } for(int i = 0;i<n;i++){ p[i] = i; } 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...