QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#741884 | #3130. Are They All Integers? | ucup-team5226# | WA | 0ms | 3532kb | C++20 | 1.0kb | 2024-11-13 15:25:08 | 2024-11-13 15:25:30 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
#define ov4(a, b, c, d, name, ...) name
#define rep3(i, a, b, c) for (ll i = (a); i < (b); i += (c))
#define rep2(i, a, b) rep3(i, a, b, 1)
#define rep1(i, n) rep2(i, 0, n)
#define rep0(n) rep1(aaaaa, n)
#define rep(...) ov4(__VA_ARGS__, rep3, rep2, rep1, rep0)(__VA_ARGS__)
const ll INF = LLONG_MAX / 4;
template <class T>
using vc = vector<T>;
template <class T>
using vvc = vc<vector<T>>;
void solve() {
ll n;
cin >> n;
vc<ll> a(n);
rep(i, n) cin >> a[i];
bool ok = true;
rep(i, n) rep(j, n) rep(k, n) {
if (i == j) continue;
if (i == k) continue;
if (k == j) continue;
ll v1 = abs(a[i] - a[j]), v2 = a[k];
if (v1 % v2) ok = false;
}
cout << (ok ? "Yes" : "No") << endl;
}
int main() {
cin.tie(0)->sync_with_stdio(0);
cout << fixed << setprecision(20);
ll t = 1;
// cin >> t;
for (int i = 1; i <= t; i++) solve();
}
详细
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3532kb
input:
5 1 1 1 1 4
output:
Yes
result:
wrong answer 1st lines differ - expected: 'yes', found: 'Yes'