답안 #17841

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
17841 2016-01-12T12:14:05 Z Erzhann 돌 무게 재기 (IZhO11_stones) C++14
36 / 100
82 ms 2760 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++;
		}
		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;
}                   									
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 2496 KB Output is correct - 73 tokens
2 Correct 0 ms 2496 KB Output is correct - 89 tokens
3 Correct 0 ms 2628 KB Output is correct - 221 tokens
4 Correct 0 ms 2496 KB Output is correct - 21 tokens
5 Correct 0 ms 2628 KB Output is correct - 369 tokens
6 Correct 0 ms 2628 KB Output is correct - 492 tokens
7 Correct 0 ms 2628 KB Output is correct - 945 tokens
8 Correct 0 ms 2628 KB Output is correct - 1237 tokens
9 Correct 0 ms 2628 KB Output is correct - 1105 tokens
10 Runtime error 18 ms 2760 KB writev (syscall #20) was called by the program (disallowed syscall)
11 Runtime error 3 ms 2760 KB writev (syscall #20) was called by the program (disallowed syscall)
12 Runtime error 0 ms 2760 KB writev (syscall #20) was called by the program (disallowed syscall)
13 Runtime error 54 ms 2760 KB writev (syscall #20) was called by the program (disallowed syscall)
14 Runtime error 53 ms 2760 KB writev (syscall #20) was called by the program (disallowed syscall)
15 Runtime error 63 ms 2760 KB writev (syscall #20) was called by the program (disallowed syscall)
16 Runtime error 67 ms 2760 KB writev (syscall #20) was called by the program (disallowed syscall)
17 Runtime error 55 ms 2760 KB writev (syscall #20) was called by the program (disallowed syscall)
18 Runtime error 67 ms 2760 KB writev (syscall #20) was called by the program (disallowed syscall)
19 Runtime error 63 ms 2760 KB writev (syscall #20) was called by the program (disallowed syscall)
20 Runtime error 48 ms 2760 KB writev (syscall #20) was called by the program (disallowed syscall)
21 Runtime error 79 ms 2760 KB writev (syscall #20) was called by the program (disallowed syscall)
22 Runtime error 81 ms 2760 KB writev (syscall #20) was called by the program (disallowed syscall)
23 Runtime error 65 ms 2760 KB writev (syscall #20) was called by the program (disallowed syscall)
24 Runtime error 82 ms 2760 KB writev (syscall #20) was called by the program (disallowed syscall)
25 Runtime error 78 ms 2760 KB writev (syscall #20) was called by the program (disallowed syscall)