QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#96198 | #2928. Espresso! | zezoo050# | WA | 2ms | 3356kb | C++20 | 706b | 2023-04-13 16:58:17 | 2023-04-13 16:58:21 |
Judging History
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'