# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1091716 | KluydQ | Weighting stones (IZhO11_stones) | C++17 | 0 ms | 344 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define FOR( i, x, n, d ) for( int i = x; i <= n; i += d )
using namespace std;
const int N = 1e5;
int main()
{
int n, sum1 = 0, sum2 = 0, max1 = 0, max2 = 0;
cin >> n;
FOR( i, 1, n, 1 )
{
int x, tp; cin >> x >> tp;
if( tp == 1 )
{
sum1 += x;
max1 = max( max1, x );
}
if( tp == 2 )
{
sum2 += x;
max2 = max( max2, x );
}
if( max1 > max2 )
{
if( sum2 >= sum1 ) cout << "?";
else cout << ">";
}
if( max2 > max1 )
{
if( sum1 >= sum2 ) cout << "?";
else cout << "<";
}
cout << '\n';
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |