QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#132233#2928. Espresso!ak19111911WA 1ms3752kbC++20500b2023-07-29 05:59:382023-07-29 05:59:42

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-07-29 05:59:42]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3752kb
  • [2023-07-29 05:59:38]
  • 提交

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'