QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#741884#3130. Are They All Integers?ucup-team5226#WA 0ms3532kbC++201.0kb2024-11-13 15:25:082024-11-13 15:25:30

Judging History

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

  • [2024-11-13 15:25:30]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3532kb
  • [2024-11-13 15:25:08]
  • 提交

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();
}

Details

Tip: Click on the bar to expand more detailed information

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'