QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#463102 | #8770. Comparator | std_abs# | WA | 0ms | 4488kb | C++20 | 640b | 2024-07-04 13:49:46 | 2024-07-04 13:49:47 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
#define pii pair<int, int>
#define all(a) a.begin(), a.end()
#define sz(a) ((int)a.size())
const int mod = 998244353, N = 100005;
int main() {
ios::sync_with_stdio(false), cin.tie(0);
int n;
ll p, c[N];
cin >> n >> p;
for (int i = 0; i < n; ++i)
cin >> c[i];
for (int i = 0; i < n; ++i) {
ll tmp = p / (i + 1);
if (tmp >= c[i] || (tmp == c[i] - 1 && p % (i + 1) != 0))
p -= c[i];
else
return cout << i << '\n', 0;
}
cout << n << '\n';
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 4488kb
input:
3 2 1 1 (x=0)&(y=1) 1 1 1 (x=1)&(y=(x^x)) 0 2 2 (x=1)|(y=0) 0 1
output:
3
result:
wrong answer 1st lines differ - expected: '0 0 0', found: '3'