QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#361808 | #8508. DiviDuelo | ucup-team1516# | WA | 1ms | 3780kb | C++17 | 942b | 2024-03-23 13:18:25 | 2024-03-23 13:18:26 |
Judging History
answer
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
ll myRand(ll B) {
return (ull)rng() % B;
}
inline double time() {
return static_cast<long double>(chrono::duration_cast<chrono::nanoseconds>(chrono::steady_clock::now().time_since_epoch()).count()) * 1e-9;
}
int main() {
cin.tie(nullptr);
ios::sync_with_stdio(false);
ll n; cin >> n;
if (n == 1) {
cout << "N" << endl;
return 0;
}
vector<ll> p;
for (ll i = 2; i*i <= n; ++i) {
while (n%i == 0) {
p.push_back(i);
n /= i;
}
}
if (n > 1) p.push_back(n);
if (p.size() <= 1 or (p.size() == 2 and p[0] == p[1])) {
cout << "N" << endl;
}
else {
cout << "Y" << endl;
}
}
詳細信息
Test #1:
score: 100
Accepted
time: 1ms
memory: 3580kb
input:
10
output:
Y
result:
ok "Y"
Test #2:
score: 0
Accepted
time: 0ms
memory: 3580kb
input:
9
output:
N
result:
ok "N"
Test #3:
score: 0
Accepted
time: 0ms
memory: 3576kb
input:
1
output:
N
result:
ok "N"
Test #4:
score: 0
Accepted
time: 0ms
memory: 3780kb
input:
549755813888
output:
Y
result:
ok "Y"
Test #5:
score: -100
Wrong Answer
time: 1ms
memory: 3544kb
input:
274877906944
output:
Y
result:
wrong answer 1st words differ - expected: 'N', found: 'Y'