QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#96195#2928. Espresso!Abdelrahman_K#WA 2ms3380kbC++14472b2023-04-13 16:56:242023-04-13 16:56:25

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-04-13 16:56:25]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:3380kb
  • [2023-04-13 16:56:24]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define F first
#define S second
const int N = 1e5 + 2;

int main() {
    int n, m; cin>>n>>m;
    int M = m;
    int ans = 0;
    for(int i = 0; i < n; i++){
        string s; cin>>s;
        int x = s[0] - '0' + (s.size() > 1);
        if(x <= m){
            m -= x;
        }
        else {
            m = M;
            ans++;
        }
    }
    cout<<ans;
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 2ms
memory: 3320kb

input:

1 10
4L

output:

0

result:

ok single line: '0'

Test #2:

score: -100
Wrong Answer
time: 1ms
memory: 3380kb

input:

15 10
3
2L
3
1
3
2L
3
4
3L
2L
3
1
4
2
4L

output:

3

result:

wrong answer 1st lines differ - expected: '5', found: '3'