제출 #1116985

#제출 시각아이디문제언어결과실행 시간메모리
1116985kirakosyan돌 무게 재기 (IZhO11_stones)C++17
0 / 100
1 ms336 KiB
#include<algorithm> #include<iostream> #include<vector> #include<string> #include<random> #include<cmath> #include<stack> #include<map> #include <iomanip> #include <queue> #include <set> using namespace std; using ll = long long; using ull = unsigned long long; ll mod = 1e9 + 7; ll pv(ll a, ll b) { if (b == 0)return 1; ll res = (pv(a, b / 2)); if (b % 2) { return (((res * res) % mod) * (a % mod)) % mod; } else { return (res * res) % mod; } } void solve() { ll n; cin >> n; ll sum = 0, sum1 = 0; for (int i = 0; i < n; i++) { int r, s; cin >> r >> s; if (s == 1) { sum += r; } else sum1 += r; if (sum > sum1) { cout << ">" << endl; } else if (sum < sum1) { cout << "<" << endl; } else cout << "?" << endl; } } signed main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cin.tie(nullptr); ll _ = 1; //cin >> _; while (_--) { solve(); } }
#Verdict Execution timeMemoryGrader output
Fetching results...