This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
//#pragma GCC optimize("Ofast,unroll-loops")
//#pragma GCC target("avx,avx2,fma")
#include "prison.h"
#include<bits/stdc++.h>
using namespace std;
vector<vector<int>> devise_strategy(int n){
vector<vector<int>> v(43, vector<int>(n+1));
for (int i=0; i<43; ++i) v[i][0]=1;
int mm=1000;
for (int r=0; r<4; ++r){
for (int i=10*r+3; i<10*(r+1)+3; ++i){
for (int j=1; j<=n; ++j){
int t=j/mm%10;
if (i%10<t) v[i][j]=-1;
if (i%10>t) v[i][j]=-2;
if (i%10==t) v[i][j]=40+r;
}
}
mm/=10;
if (r==3) break;
for (int j=1; j<=n; ++j){
v[r][j]=10*r+(j/mm)%10;
}
}
return v;
}
// int32_t main(){
// cout << devise_strategy(9);
// return 0;
// }
// int32_t main(){
// ios_base::sync_with_stdio(false);
// cin.tie(nullptr);
// #ifdef beez
// NEVER GONNA GIVE YOU UP
// NEVER GONNA LET YOU DOWN
// NEVER GONNA RUN AROUND AND DESERT YOU
// #endif // beez
// int ntests=1;
// cin >> ntests;
// while (ntests--) solve();
// return 0;
// }
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |