QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#112175#5673. CornholePetroTarnavskyi#WA 2ms3384kbC++171.1kb2023-06-10 14:55:212023-06-10 14:55:23

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-06-10 14:55:23]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:3384kb
  • [2023-06-10 14:55:21]
  • 提交

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 '