Submission #17835

# Submission time Handle Problem Language Result Execution time Memory
17835 2016-01-12T12:09:29 Z Erzhann Energetic turtle (IZhO11_turtle) C++
0 / 100
2000 ms 8172 KB
/*
  /\     /\
  | ).|.( |
  |  >-<  |
  =========
It's Adilkhan99 miaaaaaau      
*/
#include<bits/stdc++.h>

#define ll long long
#define pb push_back
#define endl "\n"
#define foreach(it, S) for(__typeof (S.begin()) it = S.begin(); it != S.end(); it++)
#define mp make_pair
#define f first
#define s second 
#define name ""
#define _ ios_base::sync_with_stdio(false);cin.tie(0);

using namespace std;
                                            
const int MaxN = int (2e5) + 256;
const int INF = int(1e9);  
const int mod = (int)(1e9) + 7;
int n, a[MaxN], m, t;
multiset<int> s, S;

int main () { _
	
	cin >> n;
	for(int i = 1; i <= n; i++){
		int x, y; cin >> x >> y;
		if(y == 2)
			S.insert(-x);		
		else s.insert(-x);
		auto I = s.begin();
		auto J = S.begin();
		bool ok = 0, ok1 = 0;
		while(I != s.end() && J != S.end()){
			if(ok && ok1){
				break;
			}
			if(-(*I) > -(*J))
				ok = 1;
			if(-(*I) < -(*J))
				ok1 = 1;
			I++;
			J++;
		}
		cerr << ok << " " << ok1 << endl;
		if(I == s.end() && J != S.end())
			ok1 = 1;
		if(J == S.end() && I != s.end())
			ok = 1;
		if(ok && ok1)
			cout << "?";
		else if(ok)
			cout << ">";
		else cout << "<";
		cout << endl;								
	}	              	
return 0;
}                   									
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 380 KB Output isn't correct
2 Incorrect 2 ms 376 KB Output isn't correct
3 Incorrect 3 ms 376 KB Output isn't correct
4 Incorrect 4 ms 376 KB Output isn't correct
5 Incorrect 5 ms 376 KB Output isn't correct
6 Incorrect 9 ms 376 KB Output isn't correct
7 Incorrect 13 ms 376 KB Output isn't correct
8 Incorrect 15 ms 504 KB Output isn't correct
9 Incorrect 68 ms 620 KB Output isn't correct
10 Incorrect 134 ms 872 KB Output isn't correct
11 Incorrect 1328 ms 5664 KB Output isn't correct
12 Execution timed out 2035 ms 8172 KB Time limit exceeded
13 Execution timed out 2078 ms 8012 KB Time limit exceeded
14 Incorrect 1460 ms 5796 KB Output isn't correct
15 Incorrect 1431 ms 5688 KB Output isn't correct
16 Execution timed out 2097 ms 7280 KB Time limit exceeded
17 Execution timed out 2013 ms 7372 KB Time limit exceeded
18 Execution timed out 2029 ms 7584 KB Time limit exceeded
19 Execution timed out 2001 ms 7320 KB Time limit exceeded
20 Execution timed out 2099 ms 7700 KB Time limit exceeded