QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#110983 | #3130. Are They All Integers? | acnockm12123 | AC ✓ | 3ms | 3748kb | C++20 | 548b | 2023-06-05 05:55:47 | 2023-06-05 05:55:48 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
const int maxn = 50;
int a[maxn];
int main()
{
int n;
scanf("%d", &n);
for (int i = 1; i <= n; i++)
scanf("%d", &a[i]);
bool flag = true;
for (int i = 1; i <= n; i++)
for (int j = 1; j <= n; j++)
for (int k = 1; k <= n; k++)
if (i != j && j != k && i != k && (a[i] - a[j]) % a[k])
flag = false;
if (flag)
printf("yes\n");
else
printf("no\n");
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 2ms
memory: 3516kb
input:
5 1 1 1 1 4
output:
yes
result:
ok single line: 'yes'
Test #2:
score: 0
Accepted
time: 2ms
memory: 3552kb
input:
5 1 2 4 8 16
output:
no
result:
ok single line: 'no'
Test #3:
score: 0
Accepted
time: 2ms
memory: 3596kb
input:
3 1 1 4
output:
yes
result:
ok single line: 'yes'
Test #4:
score: 0
Accepted
time: 0ms
memory: 3748kb
input:
50 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 96
output:
yes
result:
ok single line: 'yes'
Test #5:
score: 0
Accepted
time: 1ms
memory: 3508kb
input:
12 9 10 11 12 13 13 13 13 13 14 14 14
output:
no
result:
ok single line: 'no'
Test #6:
score: 0
Accepted
time: 0ms
memory: 3516kb
input:
7 9 9 9 9 9 9 99
output:
yes
result:
ok single line: 'yes'
Test #7:
score: 0
Accepted
time: 2ms
memory: 3704kb
input:
7 7 7 7 77 77 77 77
output:
no
result:
ok single line: 'no'
Test #8:
score: 0
Accepted
time: 2ms
memory: 3548kb
input:
5 1 1 1 99 100
output:
no
result:
ok single line: 'no'
Test #9:
score: 0
Accepted
time: 2ms
memory: 3520kb
input:
8 100 100 100 100 100 100 100 100
output:
yes
result:
ok single line: 'yes'
Test #10:
score: 0
Accepted
time: 2ms
memory: 3744kb
input:
5 1 1 1 1 4
output:
yes
result:
ok single line: 'yes'
Test #11:
score: 0
Accepted
time: 1ms
memory: 3520kb
input:
50 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96
output:
yes
result:
ok single line: 'yes'
Test #12:
score: 0
Accepted
time: 0ms
memory: 3520kb
input:
3 32 64 96
output:
no
result:
ok single line: 'no'
Test #13:
score: 0
Accepted
time: 2ms
memory: 3600kb
input:
3 3 3 87
output:
yes
result:
ok single line: 'yes'
Test #14:
score: 0
Accepted
time: 3ms
memory: 3628kb
input:
50 2 5 9 10 12 14 14 15 17 17 18 18 18 19 20 23 24 26 27 27 27 33 34 37 45 47 47 49 50 53 56 61 62 63 65 66 67 70 76 80 82 85 87 90 90 91 98 98 99 99
output:
no
result:
ok single line: 'no'
Test #15:
score: 0
Accepted
time: 3ms
memory: 3556kb
input:
50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 100
output:
yes
result:
ok single line: 'yes'
Test #16:
score: 0
Accepted
time: 0ms
memory: 3552kb
input:
50 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 97
output:
no
result:
ok single line: 'no'
Test #17:
score: 0
Accepted
time: 2ms
memory: 3516kb
input:
5 1 2 4 8 16
output:
no
result:
ok single line: 'no'