QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#110983#3130. Are They All Integers?acnockm12123AC ✓3ms3748kbC++20548b2023-06-05 05:55:472023-06-05 05:55:48

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-06-05 05:55:48]
  • 评测
  • 测评结果:AC
  • 用时:3ms
  • 内存:3748kb
  • [2023-06-05 05:55:47]
  • 提交

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;
}

Details

Tip: Click on the bar to expand more detailed information

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'