QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#391296 | #8549. The Game | ucup-team1251 | WA | 1ms | 7704kb | C++20 | 1.3kb | 2024-04-16 15:25:06 | 2024-04-16 15:25:06 |
Judging History
answer
#include <bits/stdc++.h>
#define int long long
using namespace std;
#define pii pair<int, int>
const int N = 1e6 + 5;
int ai[300000];
int bi[300000];
int ci[300000];
int m;
int check1(int sum) {
int l = 1,r = m;
while(l < r) {
int mid = (l + r) / 2;
if(bi[mid] <= sum) l = mid + 1;
else r = mid;
}
return l;
}
int check2(int sum) {
int l = 1,r = m;
while(l < r) {
int mid = (l + r) / 2;
if(ci[mid] >= sum) r = mid;
else l = mid + 1;
}
return l;
}
void solve()
{
int n,k;
int num = 1;
while(cin >> n >> m >> k) {
for(int i = 1; i <= n; i++) cin >> ai[i];
int zlm = 0;
int sum = 1;
for(int i = 1; i <= m; i++) {
int a,b;
cin >> a >> b;
bi[sum] = zlm + a;
ci[sum++] = zlm + a - b;
zlm = zlm + a - b;
}
int ans = 0;
for(int i = 1; i <= n; i++) {
int l = check1(ai[i]);
int r = check2(ai[i]);
if(l == r) continue;
else if(r - l + 1>= k) ans++;
}
cout << "Case " << num++ << ": "<< ans << endl;
}
}
signed main()
{
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int tt = 1;
// cin>>tt;
while (tt--)
{
solve();
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 7704kb
input:
3 3 1 1 4 5 1 4 2 1 2 3 4 4 1 2 2 3 2 1 1 4
output:
Case 1: 0 Case 2: 0
result:
wrong answer 1st words differ - expected: 'Qingyu', found: 'Case'