Submission #971190

# Submission time Handle Problem Language Result Execution time Memory
971190 2024-04-28T06:12:52 Z Aika Weighting stones (IZhO11_stones) C++14
0 / 100
0 ms 344 KB
#include <bits/stdc++.h>
#define int long long
#define aiiiii ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
using namespace std;

signed main(){
    aiiiii
    int n, i, j, r, s;
    cin>>n;
    int ans1=0,ans2=0;
    for(i=0;i<n;i++){
    	cin>>r>>s;
    	if(s==1)ans1+=r;
    	else ans2+=r;
    	if(ans1>ans2){
    		cout<<'>'<<endl;
    		ans1-=ans2;
    		ans2=0;
		}
    	else if(ans1<ans2){
    		cout<<'<'<<endl;
    		ans2-=ans1;
    		ans1=0;
		}
    	else{
    		cout<<'?'<<endl;
    		ans1=0;
    		ans2=0;
		} 
	}
}

Compilation message

stones.cpp: In function 'int main()':
stones.cpp:8:15: warning: unused variable 'j' [-Wunused-variable]
    8 |     int n, i, j, r, s;
      |               ^
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -