QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#96197#2928. Espresso!Deadplayer#WA 2ms3344kbC++141.3kb2023-04-13 16:57:572023-04-13 16:58:00

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

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 = 0, answer = 0;
    for(int i = 0; i < n; ++i){
        string s;
        cin >> s;
        if(s.size() == 1){
            tmp += (s[0] - '0');
        }
        if(s.size() == 2){
            tmp += (s[0] - '0') + 1;
        }
        if(tmp > k){
            tmp = tmp % k;
            answer += 1;
        }
    }
    cout << answer << endl;
}
int32_t main(){
    FastIO
    int tc = 1;
    //cin >> tc;
    while(tc--){
        doWork();
    }
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

1 10
4L

output:

0

result:

ok single line: '0'

Test #2:

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

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'