Submission #45670789
Source Code Expand
#include<bits/stdc++.h>
using namespace std;
//#define int long long
inline int read(){int x=0,f=1;char ch=getchar(); while(ch<'0'||
ch>'9'){if(ch=='-')f=-1;ch=getchar();}while(ch>='0'&&ch<='9'){
x=(x<<1)+(x<<3)+(ch^48);ch=getchar();}return x*f;}
#define Z(x) (x)*(x)
#define pb push_back
//mt19937 rand(time(0));
//mt19937_64 rand(time(0));
//srand(time(0));
//#define N
//#define M
//#define mo
int n, m, i, j, k, T;
int gcd(int a, int b) {
while(b) {
int c=a%b;
a=b; b=c;
}
return a;
}
signed main()
{
// freopen("in.txt", "r", stdin);
// freopen("out.txt", "w", stdout);
T=read();
while(T--) {
n=read();
if(n<=3) {
printf("No\n"); continue;
}
for(i=2; i*i<=n; ++i)
if(n%i==0 && gcd(i, n/i)==1) break;
printf(i*i<=n ? "Yes\n" : "No\n");
}
return 0;
}
Submission Info
| Submission Time | |
|---|---|
| Task | A - Sum equals LCM |
| User | zhangtingxi |
| Language | C++ 20 (gcc 12.2) |
| Score | 400 |
| Code Size | 836 Byte |
| Status | AC |
| Exec Time | 3 ms |
| Memory | 3716 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 400 / 400 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | 00_sample_01.txt |
| All | 00_sample_01.txt, 01_small_01.txt, 01_small_02.txt, 01_small_03.txt, 02_large_01.txt, 02_large_02.txt, 02_large_03.txt, 02_large_04.txt, 02_large_05.txt, 03_rand_01.txt, 03_rand_02.txt, 03_rand_03.txt, 04_test_01.txt, 04_test_02.txt, 04_test_03.txt, 04_test_04.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 00_sample_01.txt | AC | 1 ms | 3616 KiB |
| 01_small_01.txt | AC | 1 ms | 3492 KiB |
| 01_small_02.txt | AC | 1 ms | 3624 KiB |
| 01_small_03.txt | AC | 1 ms | 3588 KiB |
| 02_large_01.txt | AC | 3 ms | 3616 KiB |
| 02_large_02.txt | AC | 2 ms | 3688 KiB |
| 02_large_03.txt | AC | 3 ms | 3564 KiB |
| 02_large_04.txt | AC | 3 ms | 3628 KiB |
| 02_large_05.txt | AC | 3 ms | 3564 KiB |
| 03_rand_01.txt | AC | 1 ms | 3716 KiB |
| 03_rand_02.txt | AC | 1 ms | 3560 KiB |
| 03_rand_03.txt | AC | 1 ms | 3620 KiB |
| 04_test_01.txt | AC | 2 ms | 3576 KiB |
| 04_test_02.txt | AC | 3 ms | 3624 KiB |
| 04_test_03.txt | AC | 2 ms | 3592 KiB |
| 04_test_04.txt | AC | 2 ms | 3528 KiB |