Submission #792168

#TimeUsernameProblemLanguageResultExecution timeMemory
792168prvocisloUnscrambling a Messy Bug (IOI16_messy)C++17
100 / 100
2 ms480 KiB
#pragma once #include <algorithm> #include <bitset> #include <cassert> #include <chrono> #include <cmath> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <random> #include <set> #include <string> #include <vector> typedef long long ll; typedef long double ld; using namespace std; void add_element(string x); bool check_element(string x); void compile_set(); vector<int> restore_permutation(int n, int w, int r) { string s(n, '0'); for (int b = 0; (1 << b) < n; b++) { for (int i = 0; i < n; i++) if (i & (1 << b)) { s[i] = (s[i] == '0' ? '1' : '0'); add_element(s); s[i] = (s[i] == '0' ? '1' : '0'); } for (int i = 0; i < n; i++) if (i & (1 << b)) { s[i] = (s[i] == '0' ? '1' : '0'); } } compile_set(); s.assign(n, '0'); vector<int> ip(n, 0); // zistime si pre kazdy prvok ze kto bol povodne for (int b = 0; (1 << b) < n; b++) { for (int i = 0; i < n; i++) { s[i] = (s[i] == '0' ? '1' : '0'); if (check_element(s)) ip[i] ^= (1 << b); s[i] = (s[i] == '0' ? '1' : '0'); } for (int i = 0; i < n; i++) if (ip[i] & (1 << b)) { s[i] = (s[i] == '0' ? '1' : '0'); } } return ip; }

Compilation message (stderr)

messy.cpp: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...