Submission #827532

#TimeUsernameProblemLanguageResultExecution timeMemory
827532GrindMachinePrisoner Challenge (IOI22_prison)C++17
5 / 100
23 ms19128 KiB
// Om Namah Shivaya

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

template<typename T> using Tree = tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;
typedef long long int ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL)
#define pb push_back
#define endl '\n'
#define ff first
#define ss second
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define conts continue
#define sz(a) a.size()

#define rep(i,n) for(int i = 0; i < n; ++i)
#define rep1(i,n) for(int i = 1; i <= n; ++i)
#define rev(i,s,e) for(int i = s; i >= e; --i)
#define trav(i,a) for(auto &i : a)

template<typename T>
void amin(T &x, T y){
  x = min(x,y);
}

template<typename T>
void amax(T &x, T y){
  x = max(x,y);
}

#define debug(x) cout << #x << " = "; cout << x; cout << endl

const int MOD = 1e9 + 7;
const int N = 1e5 + 5;
const int inf1 = 1e9 + 5;
const ll inf2 = (ll)1e18 + 5;

#include "prison.h"

std::vector<std::vector<int>> devise_strategy(int n) {
    vector<vector<int>> a(n+1,vector<int>(n+1));
    a[0][0] = 0;
    rep1(j,n){
        a[0][j] = j;
    }

    rep1(i,n) a[i][0] = 1;
    rep1(i,n){
        rep1(j,n){
            if(i < j){
                a[i][j] = -1;
            }
            else{
                a[i][j] = -2;
            }
        }
    }

    return a;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...