QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#132233 | #2928. Espresso! | ak19111911 | WA | 1ms | 3752kb | C++20 | 500b | 2023-07-29 05:59:38 | 2023-07-29 05:59:42 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std ;
#define ll long long
int main () {
double n,s;cin>>n>>s;
double sum=0;
string a;
for(int i=0;i<n;i++) {
cin >> a;
int d=(a[0]-'0');
if(a.size()>1){
sum+=d;
sum++;
}else{
sum+=d;
}
}
sum-=s;
if(sum<0)cout<<"0\n";
else
cout<<::ceil(sum/s)<<endl;
//cout<<((int)sum/s!=sum/s?(int)sum/s+1:sum/s)<<endl;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3632kb
input:
1 10 4L
output:
0
result:
ok single line: '0'
Test #2:
score: -100
Wrong Answer
time: 1ms
memory: 3752kb
input:
15 10 3 2L 3 1 3 2L 3 4 3L 2L 3 1 4 2 4L
output:
4
result:
wrong answer 1st lines differ - expected: '5', found: '4'