QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#54047#2928. Espresso!Beevo#WA 2ms3672kbC++17661b2022-10-06 17:58:562022-10-06 17:58:58

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-10-06 17:58:58]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:3672kb
  • [2022-10-06 17:58:56]
  • 提交

answer

#include <bits/stdc++.h>

#define el '\n'
#define ll long long
#define ld long double

#define Beevo ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

using namespace std;

void testCase() {
    int n, s;
    cin >> n >> s;

    int p = s;

    string t;
    int cnt = 0;
    for (int i = 0; i < n; i++) {
        cin >> t;

        if (t.size() == 1)
            s -= t[0] - '0';
        else
            s -= t[0] - '0' + 1;

        if (s < 0)
            cnt++, s += p;
    }

    cout << cnt;
}

signed main() {
    Beevo

    int T = 1;
//    cin >> T;

    while (T--)
        testCase();

    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

1 10
4L

output:

0

result:

ok single line: '0'

Test #2:

score: -100
Wrong Answer
time: 2ms
memory: 3672kb

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'