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<iostream>
#include<stack>
#include<map>
#include<vector>
#include<string>
#include<unordered_map>
#include <queue>
#include<cstring>
#include<limits.h>
#include<cmath>
#include<set>
#include<algorithm>
#include<bitset>
#include<list>
#include "prison.h"
using namespace std;
#define ll long long
#define f first
#define endl "\n"
#define s second
#define pii pair<int,int>
#define ppii pair<pii,pii>
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define F(n) for(int i=0;i<n;i++)
#define lb lower_bound
#define ub upper_bound
#define p push
#define pb push_back
#define fastio ios::sync_with_stdio(false);cin.tie(NULL);
using namespace std;
/*
int convert(string a){
int k=0;
for(int i=0;i<a.size();i++)k+=pow(3,a[i]-'0');
return k;
}
*/
vector<vector<int>> devise_strategy(int N){
vector<vector<int>>ans(27,vector<int>(5001));
int cur=5000;
int cnt=0;
for(int j=1;j<=500;j++){
if(j>=2500)ans[0][j]=2;
else ans[0][j]=1;
}
cur/=2;
for(int i=1;i<=26;i++){
if(i%2)cur/=2,cnt++;
if(cnt%2)ans[i][0]=0;
else ans[i][0]=1;
for(int j=1;j<=5000;j++){
if(j>=cur){
if(i%2)ans[i][j]=-1+((cnt%2==1)?0:-1);
else{
if(j>=cur/2)ans[i][j]=i+2;
else ans[i][j]=i+1;
}
}
else{
if(i%2==0){
if(j>=cur/2)ans[i][j]=i+2;
else ans[i][j]=i+3;
}
else ans[i][j]=-1+((cnt%2==1)?0:-1);
}
}
}
}
Compilation message (stderr)
prison.cpp: In function 'std::vector<std::vector<int> > devise_strategy(int)':
prison.cpp:70:1: warning: no return statement in function returning non-void [-Wreturn-type]
70 | }
| ^
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |