Submission #55776198
Source Code Expand
Copy
#include<bits/stdc++.h>using namespace std;int n,t,p;int a[105],ans;int main(){cin>>n>>t>>p;for(int i=1;i<=n;i++) cin>>a[i];sort(a+1,a+n+1,greater<int>());cout<<max(t-a[p],0);}
#include<bits/stdc++.h> using namespace std; int n,t,p; int a[105],ans; int main(){ cin>>n>>t>>p; for(int i=1;i<=n;i++) cin>>a[i]; sort(a+1,a+n+1,greater<int>()); cout<<max(t-a[p],0); }
Submission Info
Submission Time | |
---|---|
Task | B - Japanese Cursed Doll |
User | zhangtj |
Language | C++ 20 (gcc 12.2) |
Score | 200 |
Code Size | 199 Byte |
Status | AC |
Exec Time | 1 ms |
Memory | 3652 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 200 / 200 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | example_00.txt, example_01.txt, example_02.txt |
All | example_00.txt, example_01.txt, example_02.txt, hand_00.txt, hand_01.txt, hand_02.txt, hand_03.txt, hand_04.txt, hand_05.txt, random_00.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
example_00.txt | AC | 1 ms | 3568 KB |
example_01.txt | AC | 1 ms | 3496 KB |
example_02.txt | AC | 1 ms | 3440 KB |
hand_00.txt | AC | 1 ms | 3496 KB |
hand_01.txt | AC | 1 ms | 3492 KB |
hand_02.txt | AC | 1 ms | 3648 KB |
hand_03.txt | AC | 1 ms | 3452 KB |
hand_04.txt | AC | 1 ms | 3452 KB |
hand_05.txt | AC | 1 ms | 3492 KB |
random_00.txt | AC | 1 ms | 3448 KB |
random_01.txt | AC | 1 ms | 3456 KB |
random_02.txt | AC | 1 ms | 3456 KB |
random_03.txt | AC | 1 ms | 3456 KB |
random_04.txt | AC | 1 ms | 3648 KB |
random_05.txt | AC | 1 ms | 3456 KB |
random_06.txt | AC | 1 ms | 3508 KB |
random_07.txt | AC | 1 ms | 3652 KB |
random_08.txt | AC | 1 ms | 3488 KB |
random_09.txt | AC | 1 ms | 3432 KB |
random_10.txt | AC | 1 ms | 3648 KB |
random_11.txt | AC | 1 ms | 3444 KB |
random_12.txt | AC | 1 ms | 3456 KB |
random_13.txt | AC | 1 ms | 3488 KB |
random_14.txt | AC | 1 ms | 3456 KB |