QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#96210#2928. Espresso!Deadplayer#AC ✓2ms3460kbC++141.3kb2023-04-13 17:09:252023-04-13 17:09:29

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 17:09:29]
  • 评测
  • 测评结果:AC
  • 用时:2ms
  • 内存:3460kb
  • [2023-04-13 17:09:25]
  • 提交

answer

#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("avx,avx2,fma")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#define debug(x) cerr << #x << " is " << x << endl;
#define FastIO ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define endl '\n'
#define pb push_back
#define F first
#define S second
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define ll long long
#define one(x) __builtin_popcount(x)
#define ld long double
#define sz(x) x.size()
using namespace std;
using namespace __gnu_pbds;
typedef tree<int,null_type,less<int>,rb_tree_tag,
tree_order_statistics_node_update> indexed_set;
ll answer = 0;
void doWork(){
    int n, k;
    cin >> n >> k;
    int tmp = k, answer = 0;
    for(int i = 0; i < n; ++i){
        string s;
        cin >> s;
        int cup = s[0] - '0';
        if(s.size() == 2){
            cup += 1;
        }
        if(tmp >= cup){
            tmp -= cup;
        }
        else{
            tmp = k;
            tmp -= cup;
            answer += 1;
        }
    }
    cout << answer << endl;
}
int32_t main(){
    FastIO
    int tc = 1;
    //cin >> tc;
    while(tc--){
        doWork();
    }
    return 0;
}

详细

Test #1:

score: 100
Accepted
time: 0ms
memory: 3460kb

input:

1 10
4L

output:

0

result:

ok single line: '0'

Test #2:

score: 0
Accepted
time: 1ms
memory: 3368kb

input:

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

output:

5

result:

ok single line: '5'

Test #3:

score: 0
Accepted
time: 2ms
memory: 3400kb

input:

8 24
1
1L
2
2L
3
3L
4
4L

output:

0

result:

ok single line: '0'

Test #4:

score: 0
Accepted
time: 2ms
memory: 3404kb

input:

8 24
1
3L
4
4L
2L
3
2
1L

output:

0

result:

ok single line: '0'

Test #5:

score: 0
Accepted
time: 0ms
memory: 3372kb

input:

100 10
3
3L
3
1
3
4
2
4L
2L
3L
3L
3
2L
1
3
4
3L
3L
2L
1
3L
2
3
3
3L
3
1
4
1L
4
2
4
3L
3
1L
2
1L
4
4
3L
4
3L
1L
1L
1
3
2
1L
3
1L
3
4L
4L
3L
4
1L
2L
2
4
1
2
1
4L
3L
1L
2L
3
2L
1L
2L
2L
3
2L
2
3L
3L
4L
1
2L
3L
4
3
3L
4L
4
3
4L
1
2
2
3L
2
1L
4
3L
4
1
3L
4
1L

output:

34

result:

ok single line: '34'

Test #6:

score: 0
Accepted
time: 2ms
memory: 3328kb

input:

100 11
3L
3L
3
2
3L
1L
2
3L
2
3
3
4
1
3
1L
2L
2L
4
2L
4L
2L
4
3
4L
4
2L
2
4L
3L
2L
3
1L
4L
2L
2L
1
2L
1
1
1L
1L
1L
2
1L
2
2
3L
1L
1
4L
4
3L
2L
4
4L
4
4
2L
3
2L
1
2L
2L
2L
2L
4L
4
3
4L
1L
2
4
1L
2L
4
2
1
2
3
4
2L
1
3L
1L
3
3L
1L
2
4
1L
3L
1
4L
4L
3L
2
1L
3L
2L
2L

output:

31

result:

ok single line: '31'

Test #7:

score: 0
Accepted
time: 1ms
memory: 3344kb

input:

100 12
1
2
1L
4
3L
3
2L
4L
1L
3
4L
3L
1
1L
4
2L
3L
4L
4
3L
1L
4
1L
4L
3L
1L
2
4
1
2
3
2L
4
2L
2
2L
4
2
4
3
4
2L
4L
2
1
4L
2L
2
3
2
1L
2L
4
3
2
1
2
4
1L
1L
4L
1L
1
1L
1
2
1L
4L
1
3
1L
3L
4
4L
1
1
4L
1L
2L
2L
2L
2L
1
2
1L
3
2L
4L
4
3
1L
1
4
4
4
3L
4
4
1L
1L

output:

27

result:

ok single line: '27'

Test #8:

score: 0
Accepted
time: 0ms
memory: 3348kb

input:

100 13
1L
2L
2
2
4L
2
4
3L
2L
4L
4L
2
1
3
4
3
1
2L
2L
4
4
3
2
3L
3
4L
3L
1
4
2
4
2
4L
4L
2
2L
2L
2L
4L
2L
4L
1
4
2L
3
1L
1L
4L
4
4L
3
1L
1L
2
4
4L
2L
1
1
3
1L
4L
1
2L
2
1L
2L
2L
1
2
2L
3L
3L
2L
3
3
4L
4
4L
4L
3
4L
4
3
1L
3
4
2L
4L
2
2
3L
3L
3
4L
4L
3L
1
2L
3L

output:

27

result:

ok single line: '27'

Test #9:

score: 0
Accepted
time: 2ms
memory: 3396kb

input:

100 15
1
4
3
2
4L
3L
1L
4
3L
3L
2
2L
1L
4L
3L
4L
1
2
3
2
2L
2
4
2
4L
1L
3
2
1L
1
2L
3
2L
1L
4
1
2L
1L
3L
4L
3L
1L
2L
3L
2L
4L
1L
1L
1L
1L
3
1L
4
3L
3
1
2
3L
4
4L
1
3
1L
4
1L
2L
1L
4
4L
4L
3L
1L
2
2
4L
1L
3L
4
1L
2
1L
3L
3
4L
2L
1
4L
2
4L
3L
4
1
4
4
4
3L
4
3L
2L
3

output:

22

result:

ok single line: '22'

Test #10:

score: 0
Accepted
time: 2ms
memory: 3396kb

input:

100 17
2
3L
1L
1L
3
2L
4
3
1L
2
3L
3
3L
2L
1
2L
3L
3
2
1L
4L
1L
3
3
4
1
2L
3L
1
2
1L
4
3
3L
3L
1L
4
2
4
2
3L
3L
1
1L
3L
4
3
2L
1L
2
2
1L
2L
1
3L
3
4
4
2L
1
2L
1
3
4L
2
4L
4L
2L
3
3
4L
4L
3L
4L
1
4L
3L
1L
3L
2
4L
1L
1L
2L
3L
2L
3L
1
2L
3
2
4L
4
1
3L
1L
4
4
2
3L

output:

19

result:

ok single line: '19'

Test #11:

score: 0
Accepted
time: 2ms
memory: 3380kb

input:

100 24
1
3
2
4
1
4
2
1L
1L
4
2
1
3L
2L
3
2L
1
1
1
1L
3
1L
2L
3L
1L
4
4
2
3
3L
1
3L
2
2
2L
4L
4L
4L
2L
1L
4
3L
4L
3
4
4L
2
3
2
4L
2L
3L
1
3L
4
1L
1L
3L
4L
4L
2
1
2
4
3
3
3L
2L
2L
4
1
4L
2L
4L
3L
4
4
1L
4L
1
1
2
4L
2
1L
4L
3L
3
4
4
4L
3
2L
2L
3
2L
1L
3
3
1

output:

13

result:

ok single line: '13'

Test #12:

score: 0
Accepted
time: 2ms
memory: 3380kb

input:

100 131
1
1L
2
2L
1
4L
3L
3L
3L
4
2
3
3
1L
3
3
1
3L
3L
4L
2
3
2
1L
2
4
4L
4L
3
3
4L
3
2
3
2L
4L
4L
4
3L
4L
2
3L
2
3
4
1L
1
2
2L
3L
4L
3
3L
3L
1
1L
3L
3
4
3L
2
1
4L
2
3L
1
1
2
4
1
1
4L
4L
2L
3L
3
3
4L
3L
4L
4
4L
1
3
1
4L
4
3
4L
3L
4L
2
4
4
4L
1L
1L
4
3L
2

output:

2

result:

ok single line: '2'

Test #13:

score: 0
Accepted
time: 2ms
memory: 3368kb

input:

100 200
2
2
2L
1
1L
3L
1L
1L
1
3L
2L
3L
3
1
2L
2L
2L
4
1L
3L
1L
2
3L
3
2
3
4
2L
2
2L
1
3L
3
2L
3L
3
4L
4
1
1L
4L
1L
2L
1
2L
4L
1
3
4L
4L
1L
2
4
2
4L
3L
3L
2L
3
3
3L
3L
4L
4
3
3L
4L
3L
1L
4
1
4L
1
1
4L
2L
2
2
4L
1L
1
3L
4L
3
2L
2L
4
2L
3L
4L
4
2
4L
1
1L
4L
4L
1
1L
1

output:

1

result:

ok single line: '1'

Test #14:

score: 0
Accepted
time: 2ms
memory: 3448kb

input:

8 10
1
2L
3
4
3L
1
1L
4L

output:

2

result:

ok single line: '2'

Test #15:

score: 0
Accepted
time: 1ms
memory: 3376kb

input:

3 12
4
4
4

output:

0

result:

ok single line: '0'