QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#433480 | #2400. Mult! | JustJie# | WA | 0ms | 3592kb | C++20 | 2.0kb | 2024-06-08 11:37:32 | 2024-06-08 11:37:33 |
Judging History
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'