QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#96198#2928. Espresso!zezoo050#WA 2ms3356kbC++20706b2023-04-13 16:58:172023-04-13 16:58:21

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:58:21]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:3356kb
  • [2023-04-13 16:58:17]
  • 提交

answer

#include <bits/stdc++.h>
#define endl '\n'
#define el '\n'
#define ll long long
#define fast                 \
    ios::sync_with_stdio(0); \
    cin.tie(0);              \
    cout.tie(0);
using namespace std;
void solve()
{
    ll n, s; cin >> n >> s;
    ll cnt = 0, tmp = s;
    for(int i = 0;i<n;i++)
    {
        string x; cin >> x;
        if(x[x.size() - 1]=='L')
        {
            x.pop_back();        
            s -= stoi(x);
            s--;
        }
        else  s -= stoi(x);

    
        if (s < 0)s = tmp, cnt++;
    }
    cout<<cnt<<el;
}
int main()
{
    fast;
    int tc = 1;
   // cin >> tc;
    while (tc--)
    {
        solve();
    }
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

1 10
4L

output:

0

result:

ok single line: '0'

Test #2:

score: -100
Wrong Answer
time: 0ms
memory: 3356kb

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'