Submission #1229564

#TimeUsernameProblemLanguageResultExecution timeMemory
1229564kaltspielerhy죄수들의 도전 (IOI22_prison)C++20
0 / 100
1096 ms320 KiB
#include <bits/stdc++.h> using namespace std; const int x = 70; vector<vector<int>> devise_strategy(int N) { vector<vector<int>> s(x+1, vector<int>(N+1)); s[0][0] = 0; for (int A = 1; A <= N; A++) { s[0][A] = (A/100)+1; } // centaines for (int A = 1; A <= 10; A++) { s[A][0] = 1; int B = 1; while (A > ((B/100)%10)+1) { s[A][B] = -2; B++; } while (A == ((B/100)%10)+1) { s[A][B] = ((B/10)%10)+11; } while (B <= N) { s[A][B] = -1; B++; } } // dizaines for (int B = 11; B <= 20; B++) { s[B][0] = 0; int A = 1; while (B > ((A/10)%10)+11) { s[B][A] = -1; A++; } while (B == ((A/10)%10)+11) { s[B][A] = (B%10)+21; } while (B <= N) { s[B][A] = -2; A++; } } // unites for (int A = 21; A <= 30; A++) { s[A][0] = 1; int B = 1; while (A > (B%10)+21) { s[A][B] = -2; B++; } while (B <= N) { s[A][B] = -1; B++; } } return s; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...