Submission #896145

#TimeUsernameProblemLanguageResultExecution timeMemory
896145boyliguanhanHappiness (Balkan15_HAPPINESS)C++17
30 / 100
2070 ms5724 KiB
#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 (stderr)

grader.cpp: In function 'int main()':
grader.cpp:16:12: warning: unused variable 'max_code' [-Wunused-variable]
   16 |  long long max_code;
      |            ^~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...