Submission #17324

# Submission time Handle Problem Language Result Execution time Memory
17324 2015-11-20T13:30:03 Z gs14004 Weighting stones (IZhO11_stones) C++14
36 / 100
1000 ms 1720 KB
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <limits.h>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <algorithm>
#include <string>
#include <functional>
#include <vector>
#include <numeric>
#include <deque>
#include <utility>
#include <bitset>
#include <iostream>
using namespace std;
typedef long long lint;
typedef long double llf;
typedef pair<int, int> pi;

bool low(vector<int> &v1, vector<int> &v2){
	int p = 0;
	if(v1.size() > v2.size()) return 0;
	for(int i=0; i<v1.size(); i++){
		if(v1[i] > v2[v2.size() - v1.size() + i]){
			return 0;
		}
	}
	return 1;
}

vector<int> v[3];
int main(){
	int q;
	scanf("%d",&q);
	while(q--){
		int a, b;
		scanf("%d %d",&b,&a);
		v[a].push_back(b);
		sort(v[1].begin(),v[1].end());
		sort(v[2].begin(),v[2].end());
		if(low(v[1], v[2])){
			puts("<");
		}
		else if(low(v[2], v[1])){
			puts(">");
		}
		else puts("?");
	}
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 1720 KB Output is correct - 73 tokens
2 Correct 0 ms 1720 KB Output is correct - 89 tokens
3 Correct 0 ms 1720 KB Output is correct - 221 tokens
4 Correct 0 ms 1720 KB Output is correct - 21 tokens
5 Correct 2 ms 1720 KB Output is correct - 369 tokens
6 Correct 3 ms 1720 KB Output is correct - 492 tokens
7 Correct 9 ms 1720 KB Output is correct - 945 tokens
8 Correct 14 ms 1720 KB Output is correct - 1237 tokens
9 Correct 13 ms 1720 KB Output is correct - 1105 tokens
10 Execution timed out 1000 ms 1720 KB Program timed out
11 Execution timed out 1000 ms 1720 KB Program timed out
12 Execution timed out 1000 ms 1720 KB Program timed out
13 Execution timed out 1000 ms 1720 KB Program timed out
14 Execution timed out 1000 ms 1720 KB Program timed out
15 Execution timed out 1000 ms 1720 KB Program timed out
16 Execution timed out 1000 ms 1720 KB Program timed out
17 Execution timed out 1000 ms 1720 KB Program timed out
18 Execution timed out 1000 ms 1720 KB Program timed out
19 Execution timed out 1000 ms 1720 KB Program timed out
20 Execution timed out 1000 ms 1720 KB Program timed out
21 Execution timed out 1000 ms 1720 KB Program timed out
22 Execution timed out 1000 ms 1720 KB Program timed out
23 Execution timed out 1000 ms 1720 KB Program timed out
24 Execution timed out 1000 ms 1720 KB Program timed out
25 Execution timed out 1000 ms 1720 KB Program timed out