# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
17326 | tncks0121 | Weighting stones (IZhO11_stones) | C++14 | 219 ms | 40980 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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++) {
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 < 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 time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |