Task: | Kortit |
Sender: | Sisuaski |
Submission time: | 2020-09-26 16:29:20 +0300 |
Language: | C++ (C++17) |
Status: | READY |
Result: | 100 |
group | verdict | score |
---|---|---|
#1 | ACCEPTED | 23 |
#2 | ACCEPTED | 77 |
test | verdict | time | group | |
---|---|---|---|---|
#1 | ACCEPTED | 0.01 s | 1, 2 | details |
#2 | ACCEPTED | 0.01 s | 2 | details |
Code
#include <iostream> #include <algorithm> using namespace std; int my[1024]; int enemy[1024]; int main() { int t;cin>>t; while(t--){ int n;cin>>n; for(int i=0; i<n/2; ++i) cin>>my[i]; sort(my, my+n/2); int r=0; for(int i=0; i<n/2; ++i) r += my[i] > 1+i+r; cout<<r<<'\n'; } }