QOJ.ac
QOJ
The 2nd Universal Cup Finals is coming! Check out our event page, schedule, and competition rules!
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#380602 | #8508. DiviDuelo | Ganny | WA | 4ms | 3848kb | C++14 | 1.4kb | 2024-04-07 06:25:16 | 2024-04-07 06:25:17 |
Judging History
answer
#include <iostream>
#include <vector>
using namespace std;
vector<pair<long long, int>> factorizacionPrima(long long numero) {
vector<pair<long long, int>> factoresPrimos;
for (long long i = 2; i * i <= numero; ++i) {
if (numero % i == 0) {
int exponente = 0;
while (numero % i == 0) {
++exponente;
numero /= i;
}
factoresPrimos.emplace_back(i, exponente);
}
}
if (numero > 1) {
factoresPrimos.emplace_back(numero, 1);
}
return factoresPrimos;
}
bool sumaExponentesEsPar(const vector<pair<long long, int>>& factoresPrimos) {
int sumaExponentes = 0;
for (const auto& factor : factoresPrimos) {
sumaExponentes += factor.second;
}
return sumaExponentes % 2 == 0;
}
int main() {
long long numero;
cin >> numero;
vector<pair<long long, int>> factoresPrimos = factorizacionPrima(numero);
bool sumaEsPar = sumaExponentesEsPar(factoresPrimos);
//for (const auto& factor : factoresPrimos) {
// cout << factor.first << "^" << factor.second << " ";
//}
if (factoresPrimos.size()%2==0 && numero != 1 && sumaEsPar){
cout << "Y" << endl;
}else if (!sumaEsPar && factoresPrimos.size()%2!=0 && factoresPrimos.size()<2){
cout << "Y" << endl;
}else{
cout << "N" << endl;
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3604kb
input:
10
output:
Y
result:
ok "Y"
Test #2:
score: 0
Accepted
time: 1ms
memory: 3540kb
input:
9
output:
N
result:
ok "N"
Test #3:
score: 0
Accepted
time: 0ms
memory: 3608kb
input:
1
output:
N
result:
ok "N"
Test #4:
score: 0
Accepted
time: 0ms
memory: 3608kb
input:
549755813888
output:
Y
result:
ok "Y"
Test #5:
score: 0
Accepted
time: 0ms
memory: 3804kb
input:
274877906944
output:
N
result:
ok "N"
Test #6:
score: 0
Accepted
time: 1ms
memory: 3580kb
input:
847288609443
output:
Y
result:
ok "Y"
Test #7:
score: 0
Accepted
time: 0ms
memory: 3540kb
input:
282429536481
output:
N
result:
ok "N"
Test #8:
score: 0
Accepted
time: 1ms
memory: 3848kb
input:
137858491849
output:
N
result:
ok "N"
Test #9:
score: 0
Accepted
time: 0ms
memory: 3616kb
input:
10604499373
output:
Y
result:
ok "Y"
Test #10:
score: 0
Accepted
time: 0ms
memory: 3600kb
input:
506623120463
output:
Y
result:
ok "Y"
Test #11:
score: 0
Accepted
time: 0ms
memory: 3848kb
input:
10779215329
output:
N
result:
ok "N"
Test #12:
score: 0
Accepted
time: 1ms
memory: 3776kb
input:
41910794561
output:
Y
result:
ok "Y"
Test #13:
score: 0
Accepted
time: 0ms
memory: 3596kb
input:
64574155417
output:
Y
result:
ok "Y"
Test #14:
score: 0
Accepted
time: 1ms
memory: 3540kb
input:
75644818241
output:
Y
result:
ok "Y"
Test #15:
score: 0
Accepted
time: 2ms
memory: 3600kb
input:
124029899611
output:
Y
result:
ok "Y"
Test #16:
score: 0
Accepted
time: 2ms
memory: 3592kb
input:
134306640043
output:
Y
result:
ok "Y"
Test #17:
score: 0
Accepted
time: 2ms
memory: 3604kb
input:
146462570411
output:
Y
result:
ok "Y"
Test #18:
score: 0
Accepted
time: 2ms
memory: 3604kb
input:
222287988673
output:
Y
result:
ok "Y"
Test #19:
score: 0
Accepted
time: 2ms
memory: 3540kb
input:
263345887171
output:
Y
result:
ok "Y"
Test #20:
score: 0
Accepted
time: 3ms
memory: 3512kb
input:
717451682557
output:
Y
result:
ok "Y"
Test #21:
score: 0
Accepted
time: 0ms
memory: 3768kb
input:
825365364157
output:
Y
result:
ok "Y"
Test #22:
score: 0
Accepted
time: 3ms
memory: 3484kb
input:
870298842859
output:
Y
result:
ok "Y"
Test #23:
score: 0
Accepted
time: 3ms
memory: 3836kb
input:
887915259331
output:
Y
result:
ok "Y"
Test #24:
score: 0
Accepted
time: 3ms
memory: 3612kb
input:
967108197509
output:
Y
result:
ok "Y"
Test #25:
score: 0
Accepted
time: 3ms
memory: 3600kb
input:
990661375799
output:
Y
result:
ok "Y"
Test #26:
score: 0
Accepted
time: 4ms
memory: 3536kb
input:
999999999989
output:
Y
result:
ok "Y"
Test #27:
score: 0
Accepted
time: 3ms
memory: 3600kb
input:
999962000357
output:
Y
result:
ok "Y"
Test #28:
score: 0
Accepted
time: 3ms
memory: 3604kb
input:
999474022513
output:
Y
result:
ok "Y"
Test #29:
score: 0
Accepted
time: 3ms
memory: 3540kb
input:
999052035451
output:
Y
result:
ok "Y"
Test #30:
score: 0
Accepted
time: 4ms
memory: 3612kb
input:
999470040641
output:
Y
result:
ok "Y"
Test #31:
score: 0
Accepted
time: 3ms
memory: 3772kb
input:
998712349711
output:
Y
result:
ok "Y"
Test #32:
score: 0
Accepted
time: 3ms
memory: 3572kb
input:
998768376647
output:
Y
result:
ok "Y"
Test #33:
score: 0
Accepted
time: 3ms
memory: 3600kb
input:
998884311283
output:
Y
result:
ok "Y"
Test #34:
score: 0
Accepted
time: 3ms
memory: 3580kb
input:
998794254709
output:
Y
result:
ok "Y"
Test #35:
score: 0
Accepted
time: 3ms
memory: 3532kb
input:
998830303021
output:
Y
result:
ok "Y"
Test #36:
score: 0
Accepted
time: 3ms
memory: 3540kb
input:
999638023157
output:
Y
result:
ok "Y"
Test #37:
score: 0
Accepted
time: 3ms
memory: 3600kb
input:
998978227997
output:
Y
result:
ok "Y"
Test #38:
score: 0
Accepted
time: 3ms
memory: 3608kb
input:
999108034891
output:
Y
result:
ok "Y"
Test #39:
score: 0
Accepted
time: 2ms
memory: 3540kb
input:
998922289621
output:
Y
result:
ok "Y"
Test #40:
score: 0
Accepted
time: 4ms
memory: 3612kb
input:
999172169371
output:
Y
result:
ok "Y"
Test #41:
score: 0
Accepted
time: 0ms
memory: 3536kb
input:
999218015981
output:
Y
result:
ok "Y"
Test #42:
score: 0
Accepted
time: 1ms
memory: 3540kb
input:
981700934653
output:
N
result:
ok "N"
Test #43:
score: 0
Accepted
time: 0ms
memory: 3848kb
input:
942804229201
output:
N
result:
ok "N"
Test #44:
score: 0
Accepted
time: 1ms
memory: 3836kb
input:
822635014967
output:
N
result:
ok "N"
Test #45:
score: 0
Accepted
time: 1ms
memory: 3772kb
input:
954312321917
output:
N
result:
ok "N"
Test #46:
score: 0
Accepted
time: 0ms
memory: 3536kb
input:
965687001953
output:
N
result:
ok "N"
Test #47:
score: 0
Accepted
time: 0ms
memory: 3552kb
input:
907803030577
output:
N
result:
ok "N"
Test #48:
score: 0
Accepted
time: 1ms
memory: 3488kb
input:
993916557163
output:
N
result:
ok "N"
Test #49:
score: 0
Accepted
time: 1ms
memory: 3540kb
input:
844029771131
output:
N
result:
ok "N"
Test #50:
score: 0
Accepted
time: 0ms
memory: 3604kb
input:
862969367597
output:
N
result:
ok "N"
Test #51:
score: 0
Accepted
time: 0ms
memory: 3608kb
input:
768706748179
output:
N
result:
ok "N"
Test #52:
score: 0
Accepted
time: 0ms
memory: 3596kb
input:
744412255649
output:
N
result:
ok "N"
Test #53:
score: 0
Accepted
time: 0ms
memory: 3608kb
input:
877760921347
output:
N
result:
ok "N"
Test #54:
score: 0
Accepted
time: 0ms
memory: 3848kb
input:
779321766481
output:
N
result:
ok "N"
Test #55:
score: 0
Accepted
time: 0ms
memory: 3576kb
input:
786676948027
output:
N
result:
ok "N"
Test #56:
score: 0
Accepted
time: 0ms
memory: 3552kb
input:
775686765629
output:
N
result:
ok "N"
Test #57:
score: 0
Accepted
time: 0ms
memory: 3604kb
input:
971230541
output:
N
result:
ok "N"
Test #58:
score: 0
Accepted
time: 0ms
memory: 3544kb
input:
2385673
output:
N
result:
ok "N"
Test #59:
score: 0
Accepted
time: 0ms
memory: 3772kb
input:
52468711
output:
N
result:
ok "N"
Test #60:
score: 0
Accepted
time: 0ms
memory: 3848kb
input:
20358337
output:
N
result:
ok "N"
Test #61:
score: 0
Accepted
time: 1ms
memory: 3608kb
input:
9186689
output:
N
result:
ok "N"
Test #62:
score: 0
Accepted
time: 0ms
memory: 3844kb
input:
106251
output:
N
result:
ok "N"
Test #63:
score: 0
Accepted
time: 1ms
memory: 3544kb
input:
2859061
output:
N
result:
ok "N"
Test #64:
score: 0
Accepted
time: 0ms
memory: 3544kb
input:
51455519
output:
N
result:
ok "N"
Test #65:
score: 0
Accepted
time: 0ms
memory: 3548kb
input:
68063771
output:
N
result:
ok "N"
Test #66:
score: 0
Accepted
time: 0ms
memory: 3804kb
input:
44480353
output:
N
result:
ok "N"
Test #67:
score: 0
Accepted
time: 0ms
memory: 3540kb
input:
445130407
output:
N
result:
ok "N"
Test #68:
score: 0
Accepted
time: 0ms
memory: 3544kb
input:
54924301
output:
N
result:
ok "N"
Test #69:
score: 0
Accepted
time: 0ms
memory: 3604kb
input:
251377811
output:
N
result:
ok "N"
Test #70:
score: 0
Accepted
time: 0ms
memory: 3604kb
input:
11583287
output:
N
result:
ok "N"
Test #71:
score: 0
Accepted
time: 0ms
memory: 3540kb
input:
164689969
output:
N
result:
ok "N"
Test #72:
score: 0
Accepted
time: 0ms
memory: 3536kb
input:
220388553874
output:
N
result:
ok "N"
Test #73:
score: 0
Accepted
time: 0ms
memory: 3600kb
input:
337917710393
output:
N
result:
ok "N"
Test #74:
score: 0
Accepted
time: 0ms
memory: 3600kb
input:
484109724475
output:
N
result:
ok "N"
Test #75:
score: 0
Accepted
time: 0ms
memory: 3844kb
input:
494253368469
output:
N
result:
ok "N"
Test #76:
score: 0
Accepted
time: 0ms
memory: 3604kb
input:
790636814905
output:
N
result:
ok "N"
Test #77:
score: -100
Wrong Answer
time: 0ms
memory: 3836kb
input:
593466711078
output:
Y
result:
wrong answer 1st words differ - expected: 'N', found: 'Y'