QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#112175 | #5673. Cornhole | PetroTarnavskyi# | WA | 2ms | 3384kb | C++17 | 1.1kb | 2023-06-10 14:55:21 | 2023-06-10 14:55:23 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
using VI = vector<int>;
using VL = vector<LL>;
using PII = pair<int, int>;
using PLL = pair<LL, LL>;
#define SZ(a) (int)a.size()
#define ALL(a) a.begin(), a.end()
#define MP make_pair
#define PB push_back
#define EB emplace_back
#define F first
#define S second
#define FOR(i, a, b) for (int i = (a); i<(b); ++i)
#define RFOR(i, b, a) for (int i = (b)-1; i>=(a); --i)
#define FILL(a, b) memset(a, b, sizeof(a))
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
int n;
cin >> n;
VI v(n);
FOR (i, 0, n)
{
cin >> v[i];
}
int k = v[0];
VI ans;
FOR (i, 1, n)
{
if (v[i] - v[i - 1] == k) continue;
else
{
int d = v[i - 1] + k - v[i];
assert(d % 2 == 0);
cerr << d << '\n';
d /= 2;
FOR (dd, 0, d) ans.PB(i + 1);
k -= d;
FOR (j, i, n) v[j] -= ((j + 1) % (i + 1)) * d;
}
FOR (j, 0, n) cout << v[j] << ' ';
cout << '\n';
}
assert(SZ(ans) == v[0]);
cout << SZ(ans) << ' ';
for (auto r : ans) cout << r << ' ';
cout << '\n';
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 2ms
memory: 3384kb
input:
2 1 0 4
output:
1 0 1 2
result:
wrong answer 1st lines differ - expected: '1 3', found: '1 0 '