QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#96208 | #2928. Espresso! | Eiad_Ahmed# | WA | 2ms | 3380kb | C++17 | 1.6kb | 2023-04-13 17:08:31 | 2023-04-13 17:08:32 |
Judging History
answer
#include <bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#define fa ios_base::sync_with_stdio(false);cin.tie(nullptr);cout.tie(0);
typedef long long ll;
typedef long double ld;
typedef double d;
typedef unsigned long long ull;
#define all(v) ((v).begin()),((v).end())
#define rall(v) ((v).rbegin()),((v).rend())
using namespace std;
using namespace __gnu_pbds;
template<typename T>
using orderedset = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
template<typename T = ll>
istream &operator>>(istream &in, vector<T> &v) {
for (auto &x: v) in >> x;
return in;
}
template<typename T = ll>
ostream &operator<<(ostream &out, const vector<T> &v) {
for (const T &x: v) out << x << ' ';
return out;
}
signed main() {
#ifndef ONLINE_JUDGE
freopen("i.txt", "r", stdin);
freopen("o.txt", "w", stdout);
#endif
fa
ll T = 1, k;
// cin >> T;
while (T--) {
int n, m;
cin >> n >> m;
int tot = 0;
int temp = m;
int ans = 0;
for (int i = 0; i < n; i++) {
string s;
cin >> s;
if (s.size() == 2) {
if (temp - (s[0] - '0')+1 < 0) {
temp = m;
ans++;
}
temp -= (s[0] - '0')+1;
} else {
if (temp - (s[0] - '0') < 0) {
temp = m;
ans++;
}
temp -= (s[0] - '0');
}
}
cout << ans << endl;
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 2ms
memory: 3344kb
input:
1 10 4L
output:
0
result:
ok single line: '0'
Test #2:
score: -100
Wrong Answer
time: 1ms
memory: 3380kb
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'