Submission #89915

# Submission time Handle Problem Language Result Execution time Memory
89915 2018-12-19T04:53:05 Z Scayre Weighting stones (IZhO11_stones) C++14
0 / 100
2 ms 256 KB
//
// omae wa mou shindeiru.
//
 
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,sse3,sse4,popcnt,abm,mmx")
 
#include <map>
#include <set>
#include <list>
#include <cmath>
#include <ctime>
#include <deque>
#include <queue>
#include <stack>
#include <string>
#include <bitset>
#include <cstdio>
#include <limits>
#include <vector>
#include <climits>
#include <cstring>
#include <cstdlib>
#include <fstream>
#include <numeric>
#include <sstream>
#include <cassert>
#include <iomanip>
#include <iostream>
#include <algorithm>
 
#define ll long long
#define ull unsigned ll
#define ioi exit(0);
 
#define f first
#define s second
 
#define inf (int)1e9 + 7
 
#define NFS ios_base :: sync_with_stdio(0), cin.tie(0), cout.tie(0);
 
#define mp make_pair
 
#define lb(x) lower_bound(x)
#define ub(x) upper_bound(x)
 
#define pb push_back
#define ppb pop_back
 
#define endl "\n"
 
#define in(x) insert(x)
 
#define sz(x) (int)x.size()
 
#define all(x) x.begin(),x.end()
 
#define pw2(x) (1<<x) //2^x
 
#define sqr(x) ((x) * 1ll * (x))
 
using namespace std;
 
const int N = (int)5e5 + 7, MOD = (int)1e9 + 7;
 
int n;
 
ll l,r;
 
int main(){ 
 
	#ifdef IOI2019
		freopen ("in.txt", "r", stdin);
	#endif
 
	freopen("stones.in","r",stdin);
  	freopen("stones.out","w",stdout);
 
	cin >> n;
 
	for(int i=1;i<=n;i++){
		int x,y;
		cin >> x >> y;
		if(y==1){
			l+=x;
		}
		else r+=x;
		if(l>r){
          	if(i==n){
              cout << '>';
              break;
            }
			cout << '>' << endl;
		}
		if(l<r){
			if(i==n){
              cout << '<';
              break;
            }
          	cout << '<' << endl;
		}
		if(l==r){
          	if(i==n){
              cout << '?';
              break;
            }
			cout << '?' << endl;
		}
	}
 
	#ifdef IOI2019
		cout << "\nTime Elapsed : " << clock () * 1.0 / CLOCKS_PER_SEC << endl;
	#endif
 
	ioi
}

Compilation message

stones.cpp: In function 'int main()':
stones.cpp:77:9: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result]
  freopen("stones.in","r",stdin);
  ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
stones.cpp:78:11: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result]
    freopen("stones.out","w",stdout);
    ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -