Submission #1078800

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
10788002024-08-28 06:19:21LittleOrangePrisoner Challenge (IOI22_prison)C++17
50 / 100
12 ms1372 KiB
#include "prison.h"
#include <vector>
#include<bits/stdc++.h>
using namespace std;
using ll = int;
const ll m = 6;
ll g(ll x, ll lv){
//cerr << "g " << x << " " << lv;
while(lv-->0) x/=m;
//cerr << " = " << x%m << "\n";
return x%m;
}
ll cal(ll x){
ll r = -1;
while(x){
r++;
x/=m;
}
return r;
}
std::vector<std::vector<int>> devise_strategy(int N) {
ll n = N;
ll lvl = cal(n);
vector<vector<ll>> ret;
vector<ll> mp;
{
vector<ll> a(n+1,0);
for(ll i = 1;i<=n;i++) a[i] = g(i,lvl)+1;
ret.push_back(a);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

prison.cpp: In function 'std::vector<std::vector<int> > devise_strategy(int)':
prison.cpp:34:14: warning: suggest parentheses around arithmetic in operand of '^' [-Wparentheses]
   34 |     ll tp = j&1^1;
      |             ~^~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...