# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
629465 | jeff252 | Prisoner Challenge (IOI22_prison) | C++17 | 1 ms | 300 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
#define fi first
#define se second
#define pitem item*
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<ll> vl;
const int N=1e6+10;
const int SS=1<<19;
const int INFi=2e9;
const ll INFl=1e13;
const ll mod2=998244353;
const ll mod=1e9+7;
const ll mod3=1000696969;
const ll p=70032301;
const ull p2=913;
const int L=20;
int Find(int a,int ind){
vi res;
while(a>0){
res.push_back(a%10);
a/=10;
}
reverse(res.begin(),res.end());
if(ind>res.size()) return -1;
return res[ind-1];
}
vector<vi> devise_strategy(int n){
vector<vi>res;
for(int i=0;i<=49;i++){
vi curr;
if(i>=0 and i<=3){
curr.push_back(0);
for(int i2=1;i2<=n;i2++){
curr.push_back((i+1)*10+Find(i2,i+1));
}
}else{
curr.push_back(1);
int kt=Find(i,1),val=Find(i,2);
for(int i2=1;i2<=n;i2++){
int kt2=Find(i2,kt);
if(kt2==-1 or val>kt2){
curr.push_back(-1);
continue;
}
if(val==-1 or val<kt2){
curr.push_back(-2);
continue;
}
curr.push_back(kt);
}
}
res.push_back(curr);
}
return res;
}
/*int main(){
ios_base::sync_with_stdio(0),cin.tie(0);
int tt=1;
int n;
cin>>n;
vector<vi> res=devise_strategy(n);
for(int i=0;i<res.size();i++){
for(int i2=0;i2<res[i].size();i2++) cout<<res[i][i2]<<" ";
cout<<"\n";
}
}*/
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |