Submission #626113

# Submission time Handle Problem Language Result Execution time Memory
626113 2022-08-11T08:36:47 Z Black_Ghost Prisoner Challenge (IOI22_prison) C++17
38 / 100
24 ms 1612 KB
#include "prison.h"
#include <bits/stdc++.h>
#include <vector>
#define pb push_back
using namespace std;
std::vector<std::vector<int>> devise_strategy(int N) {
  int n=N;
  std::vector<std::vector<int>> v;
  vector<int> newv;
  // 0 1-9 
  int ran=13;
  newv.pb(0);
  /*1-9 1000 2000 4000 
  10-18
  19-26*/
  for(int i=1;i<=n;i++){
      int s=pow(2,ran-1);
      if((s&i))
      newv.pb(ran);
      else
        newv.pb(ran*2);
      //cout<<s;
  }
  v.pb(newv);
  newv.clear();
  for(int k=1;k<=ran;k++){
    newv.pb(1);
    for(int i=1;i<=n;i++){
        int y=pow(2,k-1);
        if((y&i))
          newv.pb(ran*2+k-1);
        else
          newv.pb(-2);
    }
    v.pb(newv);
    newv.clear();
  }
  for(int k=ran+1;k<=ran*2;k++){
    newv.pb(1);
    for(int i=1;i<=n;i++){
        int y=pow(2,k-ran-1);
        if((y&i))
          newv.pb(-1);
        else
          newv.pb(ran*2+k-ran-1);
    }
    v.pb(newv);
    newv.clear();
  }
  for(int k=ran*2+1;k<=ran*3-1;k++){
      newv.pb(0);
       for(int i=1;i<=n;i++){
        int y=pow(2,k-ran*2-1);
        if((y&i))
          newv.pb(k-ran*2);
        else
          newv.pb(k-ran);
    }
    v.pb(newv);
    newv.clear();
  }

  return v;
}
/*
8   8 16

8   8 16 
*/
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 2 ms 340 KB Output is correct
4 Correct 2 ms 348 KB Output is correct
5 Correct 2 ms 340 KB Output is correct
6 Correct 3 ms 348 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 2 ms 340 KB Output is correct
9 Correct 2 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 2 ms 340 KB Output is correct
4 Correct 2 ms 340 KB Output is correct
5 Correct 3 ms 340 KB Output is correct
6 Correct 3 ms 340 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Correct 1 ms 340 KB Output is correct
9 Correct 3 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Partially correct 0 ms 212 KB Output is partially correct
3 Partially correct 0 ms 212 KB Output is partially correct
4 Partially correct 11 ms 888 KB Output is partially correct
5 Partially correct 18 ms 1352 KB Output is partially correct
6 Partially correct 22 ms 1612 KB Output is partially correct
7 Partially correct 24 ms 1572 KB Output is partially correct
8 Partially correct 0 ms 212 KB Output is partially correct
9 Partially correct 2 ms 340 KB Output is partially correct
10 Partially correct 4 ms 468 KB Output is partially correct
11 Partially correct 9 ms 812 KB Output is partially correct
12 Partially correct 20 ms 1280 KB Output is partially correct