QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#618333 | #9272. Fun at Luggage Claim | artinz# | Compile Error | / | / | Python3 | 1.4kb | 2024-10-06 21:04:15 | 2024-10-06 21:04:16 |
Judging History
This is the latest submission verdict.
- [2024-10-06 21:04:16]
- Judged
- Verdict: Compile Error
- Time: 0ms
- Memory: 0kb
- [2024-10-06 21:04:15]
- Submitted
answer
#include <bits/stdc++.h>
using namespace std;
using lli = int64_t;
using pii = pair<int, int>;
using vint = vector<int>;
using triple = pair<int, pii>;
using C = int;
using P = complex<C>;
const int MX = 505;
const int MOD = 1e9 + 7;
lli n, m;
lli res = 0;
void solve() {
int n;
cin >> n;
int a[n];
int mx = INT_MIN, imx = -1;
for (int i = 0; i < n; i++) {
cin >> a[i];
if (a[i] >= mx) {
mx = a[i];
imx = i;
}
}
int b[n];
for (int i = 0; i < n; i++) {
cin >> b[i];
}
int d = a[imx] - b[imx];
if (d % 2 == 1) {
cout << "No";
return;
}
a[(n + imx + 1) % n] += d / 2;
a[(n + imx - 1) % n] += d / 2;
d = - a[(n + imx + 1) % n] + b[(n + imx + 1) % n];
if (d < 0) {
cout << "No";
return;
}
a[(n + imx + 2) % n] -= 2 * d;
a[(n + imx + 1) % n] += d;
a[(n + imx + 3) % n] += d;
a[imx] = b[imx];
for (int i = 0; i < n; i++) {
if (a[i] != b[i]) {
cout << "No";
return;
}
}
cout << "Yes";
}
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
int t = 1;
// cin >> t;
while (t--) {
solve();
cout << '\n';
}
return 0;
}
详细
File "answer.code", line 3 using namespace std; ^^^^^^^^^ SyntaxError: invalid syntax