# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
896145 | 2023-12-31T22:17:35 Z | boyliguanhan | Happiness (Balkan15_HAPPINESS) | C++17 | 2000 ms | 5724 KB |
#include "happiness.h" #include<bits/stdc++.h> using namespace std; multiset<long long> st; bool init(int coinsCount, long long maxCoinSize, long long coins[]) { for(int i = 0; i < coinsCount; i++) st.insert(coins[i]); long long sum=0; for(auto i: st) if(sum+1<i) return 0; else sum+=i; return 1; } bool is_happy(int event, int coinsCount, long long coins[]) { for(int i = 0; i < coinsCount; i++) if(event<0) st.erase(st.find(coins[i])); else st.insert(coins[i]); long long sum=0; for(auto i: st) if(sum+1<i) return 0; else sum+=i; return 1; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Correct | 0 ms | 348 KB | Output is correct |
3 | Correct | 0 ms | 348 KB | Output is correct |
4 | Correct | 0 ms | 348 KB | Output is correct |
5 | Correct | 0 ms | 348 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Correct | 0 ms | 348 KB | Output is correct |
3 | Correct | 0 ms | 348 KB | Output is correct |
4 | Correct | 0 ms | 348 KB | Output is correct |
5 | Correct | 0 ms | 348 KB | Output is correct |
6 | Correct | 1 ms | 348 KB | Output is correct |
7 | Correct | 1 ms | 348 KB | Output is correct |
8 | Correct | 86 ms | 860 KB | Output is correct |
9 | Correct | 87 ms | 964 KB | Output is correct |
10 | Correct | 101 ms | 964 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Correct | 0 ms | 348 KB | Output is correct |
3 | Correct | 0 ms | 348 KB | Output is correct |
4 | Correct | 0 ms | 348 KB | Output is correct |
5 | Correct | 0 ms | 348 KB | Output is correct |
6 | Execution timed out | 2070 ms | 5724 KB | Time limit exceeded |
7 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Correct | 0 ms | 348 KB | Output is correct |
3 | Correct | 0 ms | 348 KB | Output is correct |
4 | Correct | 0 ms | 348 KB | Output is correct |
5 | Correct | 0 ms | 348 KB | Output is correct |
6 | Correct | 1 ms | 348 KB | Output is correct |
7 | Correct | 1 ms | 348 KB | Output is correct |
8 | Correct | 86 ms | 860 KB | Output is correct |
9 | Correct | 87 ms | 964 KB | Output is correct |
10 | Correct | 101 ms | 964 KB | Output is correct |
11 | Execution timed out | 2070 ms | 5724 KB | Time limit exceeded |
12 | Halted | 0 ms | 0 KB | - |