?
# | Author | Problem | Lang | Verdict | Time | Memory | Sent | Judged | |
---|---|---|---|---|---|---|---|---|---|
208946170 |
Practice: sandeep_iitpkd |
282B - 25 | GNU C++17 | Time limit exceeded on test 10 | 5000 ms | 8 KB | 2023-06-08 06:10:15 | 2023-06-08 06:10:15 |
#include <iostream> using namespace std; // greedy // it can be proved that '-1' will not occur int main(){ int n, a, g; cin >> n; int sum {0}; for(int i = 0; i < n; i ++){ cin >> a >> g; if(sum + a <= 500){ cout << "A"; sum += a; }else{ cout << "G"; sum -= g; } } cout << endl; return 0; }
?
?
?
?