QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#361720 | #8508. DiviDuelo | ucup-team3099# | WA | 3ms | 3884kb | C++14 | 2.6kb | 2024-03-23 13:04:16 | 2024-03-23 13:04:17 |
Judging History
answer
#include <iostream>
#include <vector>
#include <chrono>
#include <random>
#include <cassert>
std::mt19937 rng((int) std::chrono::steady_clock::now().time_since_epoch().count());
int main() {
std::ios_base::sync_with_stdio(false); std::cin.tie(NULL);
long long n;
std::cin >> n;
std::string ans = "N";
for(long long i = 2; i * i <= n; i++) {
int e = 0;
while(n % i == 0) {
e++;
n /= i;
}
if(e & 1) {
ans = "Y";
}
}
if(n != 1) {
ans = "Y";
}
std::cout << ans << '\n';
}
/*
NEVER FORGET TO:
Look at the problem's constraints before coding.
How to cheese cf:
Find a lower bound or upper bound for the problem. Have faith that it is the answer of the problem.
If it isn't the answer, have more faith or change to another bound god by looking for a better bound.
Trust guesses. Who has time to think? If people in div2 AC the problem it requires no proof since people don't prove things.
You must draw cases. Thinking gets you nowhere, so draw cases and reach illogical conclusions from them.
Sometimes drawing cases is bad because it takes too much time. Faster is to not think at all and just code a bruteforce solution.
This is called "law of small numbers". If something works for small numbers, surely it works for big numbers.
https://en.wikipedia.org/wiki/Faulty_generalization#Hasty_generalization don't mind the "faulty" part of it, in competitive programming mistakes are lightly punished
Don't think about them being right or not, cf is a battle of intuition only.
Be as stupid as possible in implementation. Trying to be smart is an easy way to get WA.
Think about 2x2 cases for matrix problems and hope that everything works for the general case.
Find a necessary condition and trust it to be sufficient. They're basically the same thing.
Heuristics might speed up your code. Forget about complexity, it's only about ACing and not proving that your solution is good.
For paths in a grid starting at (1, i) or something like that, assume that they never cross and do D&C
Consider doing problems in reverse order of queries/updates
For combinatorics problems, consider symmetry
General strategy (MUST DO):
Try to solve the problem with more restricted constraints.
About testing:
Test n=1, a[i]=1, a[i]=n, etc. Basically, test low values. No need to test if pretests are strong, but if you get WA it's good.
This isn't a joke. Do it if you get stuck. It's shit practice in my opinion, but do it if you want AC.
*/
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3572kb
input:
10
output:
Y
result:
ok "Y"
Test #2:
score: 0
Accepted
time: 0ms
memory: 3588kb
input:
9
output:
N
result:
ok "N"
Test #3:
score: 0
Accepted
time: 0ms
memory: 3532kb
input:
1
output:
N
result:
ok "N"
Test #4:
score: 0
Accepted
time: 0ms
memory: 3548kb
input:
549755813888
output:
Y
result:
ok "Y"
Test #5:
score: 0
Accepted
time: 0ms
memory: 3844kb
input:
274877906944
output:
N
result:
ok "N"
Test #6:
score: 0
Accepted
time: 0ms
memory: 3640kb
input:
847288609443
output:
Y
result:
ok "Y"
Test #7:
score: 0
Accepted
time: 0ms
memory: 3636kb
input:
282429536481
output:
N
result:
ok "N"
Test #8:
score: 0
Accepted
time: 0ms
memory: 3644kb
input:
137858491849
output:
N
result:
ok "N"
Test #9:
score: 0
Accepted
time: 0ms
memory: 3884kb
input:
10604499373
output:
Y
result:
ok "Y"
Test #10:
score: 0
Accepted
time: 0ms
memory: 3580kb
input:
506623120463
output:
Y
result:
ok "Y"
Test #11:
score: 0
Accepted
time: 0ms
memory: 3644kb
input:
10779215329
output:
N
result:
ok "N"
Test #12:
score: 0
Accepted
time: 1ms
memory: 3640kb
input:
41910794561
output:
Y
result:
ok "Y"
Test #13:
score: 0
Accepted
time: 1ms
memory: 3644kb
input:
64574155417
output:
Y
result:
ok "Y"
Test #14:
score: 0
Accepted
time: 1ms
memory: 3580kb
input:
75644818241
output:
Y
result:
ok "Y"
Test #15:
score: 0
Accepted
time: 1ms
memory: 3644kb
input:
124029899611
output:
Y
result:
ok "Y"
Test #16:
score: 0
Accepted
time: 1ms
memory: 3580kb
input:
134306640043
output:
Y
result:
ok "Y"
Test #17:
score: 0
Accepted
time: 1ms
memory: 3640kb
input:
146462570411
output:
Y
result:
ok "Y"
Test #18:
score: 0
Accepted
time: 2ms
memory: 3644kb
input:
222287988673
output:
Y
result:
ok "Y"
Test #19:
score: 0
Accepted
time: 2ms
memory: 3648kb
input:
263345887171
output:
Y
result:
ok "Y"
Test #20:
score: 0
Accepted
time: 3ms
memory: 3644kb
input:
717451682557
output:
Y
result:
ok "Y"
Test #21:
score: 0
Accepted
time: 3ms
memory: 3644kb
input:
825365364157
output:
Y
result:
ok "Y"
Test #22:
score: 0
Accepted
time: 3ms
memory: 3700kb
input:
870298842859
output:
Y
result:
ok "Y"
Test #23:
score: 0
Accepted
time: 3ms
memory: 3584kb
input:
887915259331
output:
Y
result:
ok "Y"
Test #24:
score: 0
Accepted
time: 3ms
memory: 3644kb
input:
967108197509
output:
Y
result:
ok "Y"
Test #25:
score: 0
Accepted
time: 3ms
memory: 3648kb
input:
990661375799
output:
Y
result:
ok "Y"
Test #26:
score: 0
Accepted
time: 0ms
memory: 3556kb
input:
999999999989
output:
Y
result:
ok "Y"
Test #27:
score: 0
Accepted
time: 3ms
memory: 3884kb
input:
999962000357
output:
Y
result:
ok "Y"
Test #28:
score: 0
Accepted
time: 3ms
memory: 3580kb
input:
999474022513
output:
Y
result:
ok "Y"
Test #29:
score: 0
Accepted
time: 3ms
memory: 3704kb
input:
999052035451
output:
Y
result:
ok "Y"
Test #30:
score: 0
Accepted
time: 3ms
memory: 3572kb
input:
999470040641
output:
Y
result:
ok "Y"
Test #31:
score: 0
Accepted
time: 0ms
memory: 3808kb
input:
998712349711
output:
Y
result:
ok "Y"
Test #32:
score: 0
Accepted
time: 3ms
memory: 3640kb
input:
998768376647
output:
Y
result:
ok "Y"
Test #33:
score: 0
Accepted
time: 0ms
memory: 3844kb
input:
998884311283
output:
Y
result:
ok "Y"
Test #34:
score: 0
Accepted
time: 3ms
memory: 3552kb
input:
998794254709
output:
Y
result:
ok "Y"
Test #35:
score: 0
Accepted
time: 3ms
memory: 3644kb
input:
998830303021
output:
Y
result:
ok "Y"
Test #36:
score: 0
Accepted
time: 3ms
memory: 3572kb
input:
999638023157
output:
Y
result:
ok "Y"
Test #37:
score: 0
Accepted
time: 3ms
memory: 3716kb
input:
998978227997
output:
Y
result:
ok "Y"
Test #38:
score: 0
Accepted
time: 3ms
memory: 3712kb
input:
999108034891
output:
Y
result:
ok "Y"
Test #39:
score: 0
Accepted
time: 3ms
memory: 3636kb
input:
998922289621
output:
Y
result:
ok "Y"
Test #40:
score: 0
Accepted
time: 3ms
memory: 3644kb
input:
999172169371
output:
Y
result:
ok "Y"
Test #41:
score: 0
Accepted
time: 0ms
memory: 3704kb
input:
999218015981
output:
Y
result:
ok "Y"
Test #42:
score: -100
Wrong Answer
time: 0ms
memory: 3576kb
input:
981700934653
output:
Y
result:
wrong answer 1st words differ - expected: 'N', found: 'Y'