Submission #17327

#TimeUsernameProblemLanguageResultExecution timeMemory
17327tncks0121Weighting stones (IZhO11_stones)C++14
0 / 100
473 ms80240 KiB
#include <stdio.h>
#include <stdlib.h>
#include <bits/stdc++.h>

using namespace std;

const int TRIALS = 200;
int N;
int X[TRIALS][100500];
long long L[100], R[100];
int main() {
  scanf("%d", &N);
  for(int i = 0; i < TRIALS; i++) {
  	X[i][0] = rand() % 10000 + 1;
    for(int j = 1; j < N; j++) X[i][j] = X[i][j - 1] + rand() % 10000 + 1;
  }
  
  while(N--) {
    int P, S; scanf("%d%d", &P, &S);
    bool a1 = false, a2 = false;
    for(int i = 0; i < TRIALS; i++) {
      (S == 1 ? L : R)[i] += X[i][P - 1];
      if(L[i] < R[i]) a1 = true;
      if(L[i] > R[i]) a2 = true;
    }
    if(a1 ^ a2) {
      puts(a1 ? "<" : ">");
    }else {
      puts("?");
    }
  }
  
  return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...