Submission #17325

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

using namespace std;

int N;
int X[100][100500];
long long L[100], R[100];
int main() {
  scanf("%d", &N);
  for(int i = 0; i < 100; i++) {
    for(int j = 0; j < N; j++) X[i][j] = rand() % 10000 + 1;
    sort(X[i], X[i] + N);
  }
  
  while(N--) {
    int P, S; scanf("%d%d", &P, &S);
    bool a1 = false, a2 = false;
    for(int i = 0; i < 100; 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...