Submission #541546

# Submission time Handle Problem Language Result Execution time Memory
541546 2022-03-23T18:13:18 Z AmirElarbi Last supper (IOI12_supper) C++14
0 / 100
2500 ms 13236 KB
#include <bits/stdc++.h>
#define vi vector<int>
#define ve vector
#define ll long long
#define vf vector<float>
#define vll vector<pair<ll,ll>>
#define ii pair<int,int>
#define pll pair<ll,ll>
#define vvi vector<vi>
#define vii vector<ii>
#define gii greater<ii>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define INF 2e9+5
#define eps 1e-7
#define eps1 1e-25
#define optimise ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define MAX_A 1e5+5
#define V 450
using namespace std;
const int MOD = 1e9;
const int nax = 1e5+5;
#include "advisor.h"
void ComputeAdvice(int *c, int n, int k, int m) {
  for (int i = 0; i < n; ++i)
  {
     for (int j = 13; j >= 0; --j)
     {
        if((c[i] & (int)(pow(2,j))) == (int)(pow(2,j))){
          WriteAdvice(1);
        }else {
          WriteAdvice(0);
        }
     }
  }
}
#include <bits/stdc++.h>
#define vi vector<int>
#define ve vector
#define ll long long
#define vf vector<float>
#define vll vector<pair<ll,ll>>
#define ii pair<int,int>
#define pll pair<ll,ll>
#define vvi vector<vi>
#define vii vector<ii>
#define gii greater<ii>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define INF 2e9+5
#define eps 1e-7
#define eps1 1e-25
#define optimise ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define MAX_A 1e5+5
#define V 450
using namespace std;
const int MOD = 1e9;
const int nax = 5e3+5;
#include "assistant.h"
bool vis[nax];
void Assist(unsigned char *a, int n, int k, int r) {
   vi vals;
   int i;
   for (i = 0; i < n; i++) {
      int cur = 0;
      for (int j = 0; j <= 13; ++j)
      {
         if(a[i*14 + j] == '1'){
            cur += (int)(pow(2,13-j));
         }
      }
      vals.pb(cur);
   }
   vi sch(n+1,0);
   for (int i = 0; i < k; ++i)
   {
      sch[i] = 1;
   }
   for (int i = 0; i < n; ++i)
   {
      int req = GetRequest();
      if(sch[req]) continue;
      int rem = 0;
      for (int j = 0; j < n; ++j)
      {
         if(sch[j]){
            rem = j; break;
         }
      }
      memset(vis,0,sizeof vis);
      for (int j = i+1; j < n; ++j)
      {
         if(!vis[vals[j]] && sch[vals[j]]){
            vis[vals[j]] = 1;
            rem = vals[j];
         }
      }
      sch[rem] = 0;
      sch[req] = 1;
      PutBack(rem);
   }
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 512 KB Output isn't correct - not an optimal way
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 87 ms 1796 KB Output isn't correct - not an optimal way
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2521 ms 10560 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 636 KB Error - advice is too long
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2528 ms 13064 KB Time limit exceeded
2 Execution timed out 2534 ms 13116 KB Time limit exceeded
3 Execution timed out 2575 ms 12948 KB Time limit exceeded
4 Execution timed out 2583 ms 13064 KB Time limit exceeded
5 Execution timed out 2562 ms 13060 KB Time limit exceeded
6 Execution timed out 2509 ms 13100 KB Time limit exceeded
7 Execution timed out 2552 ms 13032 KB Time limit exceeded
8 Execution timed out 2558 ms 13024 KB Time limit exceeded
9 Execution timed out 2562 ms 13236 KB Time limit exceeded
10 Execution timed out 2566 ms 12968 KB Time limit exceeded