Submission #652398

#TimeUsernameProblemLanguageResultExecution timeMemory
652398BlagojPrisoner Challenge (IOI22_prison)C++17
0 / 100
1 ms340 KiB
#include "prison.h" #include <bits/stdc++.h> using namespace std; std::vector<std::vector<int>> devise_strategy(int N) { vector<vector<int>> v(40); for (int i = 0; i <= 40; i++) { if (i == 0) { v[i].push_back(0); for (int j = 1; j <= N; j++) { int k = j; while (k > 9) { k /= 10; } v[i].push_back(10 + k); } continue; } if (i / 10 == 0) { v[i].push_back(0); for (int j = 1; j <= N; j++) { int k = j, l = 999; if (i % 10 == 1) { l = 99; } while (k > l) { k /= 10; } v[i].push_back((i % 10 + 1) * 10 + k % 10); } continue; } v[i].push_back(1); for (int j = 1; j <= N; j++) { int k = j, l = 999; if (i / 10 == 1) { l = 9; } if (i / 10 == 2) { l = 99; } while (k > l) { k /= 10; } k %= 10; if (k > i % 10) { v[i].push_back(-1); continue; } if (k < i % 10) { v[i].push_back(-2); continue; } v[i].push_back((i % 10)); } } return v; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...