QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#433480#2400. Mult!JustJie#WA 0ms3592kbC++202.0kb2024-06-08 11:37:322024-06-08 11:37:33

Judging History

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

  • [2024-06-08 11:37:33]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3592kb
  • [2024-06-08 11:37:32]
  • 提交

answer

/***************************************************************************************************
 * author : Jie Chen (4th Year CS)
 * school : Rochester Institute of Technology
 * created: 06.07.2024 23:31:21
****************************************************************************************************/
#include "bits/stdc++.h"

using namespace std;

namespace reader {
template<typename T, typename U> pair<T, U>& operator--(pair<T, U>& p) { p.first--; p.second--; return p; }
template<typename T, typename U> pair<T, U>& operator++(pair<T, U>& p) { p.first++; p.second++; return p; }
template<typename T, typename U> istream& operator>>(istream& is, pair<T, U>& p){ is >> p.first >> p.second; return is; }
template<typename T, typename U> ostream& operator<<(ostream& os, const pair<T, U>& p){ os << p.first << " " << p.second; return os; }
template<typename T> vector<T>& operator--(vector<T> &a) { for (auto& x : a) x--; return a; }
template<typename T> vector<T>& operator++(vector<T> &a) { for (auto& x : a) x++; return a; }
template<typename T> istream& operator>>(istream& is, vector<T> &a) { for (auto& x : a) is >> x; return is;}
template<typename T> ostream& operator<<(ostream& os, const vector<T>& a) { for (int x : a) os << x << " "; return os; }
};
using namespace reader;

using i64 = long long;

constexpr int LIM = 101;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int n;
    cin >> n;

    vector<int> a(n);
    cin >> a;

    vector<int> good(n);
    int marked[LIM] {};
    for (int i = 0; i < n; i++) {
        int f = -1;
        for (int j = 0; j < n; j++) {
            if (i != j && a[j] % a[i] == 0) {
                good[i]++;
                f = j;
            }
        }
        if (good[i] == 1) {
            marked[a[f]] = 1;
        }
    }

    for (int i = 1; i < LIM; i++) {
        if (marked[i]) {
            cout << i << "\n";  
        }
    }
}

// ~ Just Jie

详细

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3592kb

input:

25
2
4
6
8
10
12
14
16
18
20
22
24
26
28
30
32
34
36
38
40
42
44
46
48
50

output:

36
40
44
48

result:

wrong answer 1st lines differ - expected: '4', found: '36'