# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
87035 | 2018-11-29T09:11:08 Z | YottaByte | Weighting stones (IZhO11_stones) | C++14 | 3 ms | 376 KB |
#include <iostream> #include <iomanip> #include <math.h> using namespace std; #define pb push_back #define ins insert #define fr first #define sc second const int N = 3e5; int ll, rr; int sl, sr; main() { int n; cin >> n; int r, s; for(int i = 1; i <= n; i++) { cin >> r >> s; if(s == 2) { rr = max(rr, r); sr += r; if(sr <= sl && rr > ll) { cout << '?' << endl; continue; } if(rr > ll) { cout << '<' << endl; continue; } else { cout << '>' << endl; continue; } } else { ll = max(ll, r); sl += r; if(sr >= sl && ll > rr) { cout << '?' << endl; continue; } if(rr > ll) { cout << '<' << endl; continue; } else { cout << '>' << endl; continue; } } } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 3 ms | 376 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |