QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#225930#3130. Are They All Integers?Abtahi#AC ✓1ms3740kbC++201.2kb2023-10-25 12:19:562023-10-25 12:19:57

Judging History

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

  • [2023-10-25 12:19:57]
  • 评测
  • 测评结果:AC
  • 用时:1ms
  • 内存:3740kb
  • [2023-10-25 12:19:56]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<int,int> pii;
typedef vector<int> vii;
typedef vector<ll> vll;
typedef vector<pii> vpii;
typedef unordered_map<int,int> umap;
typedef long double ld;
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define popcount __builtin_popcount
#define case cout<<"Case "<<__testcase-testcase<<": ";
#define endl '\n'
int a[100];
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int testcase=1;
    //cin>>testcase;
    int __testcase=testcase;
    while(testcase--){
        int n;
        cin>>n;
        int i,j,k;
        for(i=0;i<n;i++)
        {
            cin>>a[i];
        }
        bool ind=1;
        for(i=0;i<n;i++)
        {
            for(j=0;j<n;j++)
            {
                if(j==i) continue;

                for(k=0;k<n;k++)
                {
                    if(k==j||k==i) continue;

                    if((a[i]-a[j])%a[k]!=0)
                    {
                        ind=0;
                    }
                }
            }
        }
        if(ind)cout<<"yes";
        else cout<<"no";
        cout<<endl;
    }
}






詳細信息

Test #1:

score: 100
Accepted
time: 0ms
memory: 3692kb

input:

5
1 1 1 1 4

output:

yes

result:

ok single line: 'yes'

Test #2:

score: 0
Accepted
time: 0ms
memory: 3732kb

input:

5
1 2 4 8 16

output:

no

result:

ok single line: 'no'

Test #3:

score: 0
Accepted
time: 0ms
memory: 3632kb

input:

3
1 1 4

output:

yes

result:

ok single line: 'yes'

Test #4:

score: 0
Accepted
time: 0ms
memory: 3616kb

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: 0ms
memory: 3732kb

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: 3676kb

input:

7
9 9 9 9 9 9 99

output:

yes

result:

ok single line: 'yes'

Test #7:

score: 0
Accepted
time: 0ms
memory: 3740kb

input:

7
7 7 7 77 77 77 77

output:

no

result:

ok single line: 'no'

Test #8:

score: 0
Accepted
time: 0ms
memory: 3672kb

input:

5
1 1 1 99 100

output:

no

result:

ok single line: 'no'

Test #9:

score: 0
Accepted
time: 0ms
memory: 3688kb

input:

8
100 100 100 100 100 100 100 100

output:

yes

result:

ok single line: 'yes'

Test #10:

score: 0
Accepted
time: 0ms
memory: 3668kb

input:

5
1 1 1 1 4

output:

yes

result:

ok single line: 'yes'

Test #11:

score: 0
Accepted
time: 0ms
memory: 3668kb

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: 3656kb

input:

3
32 64 96

output:

no

result:

ok single line: 'no'

Test #13:

score: 0
Accepted
time: 0ms
memory: 3732kb

input:

3
3 3 87

output:

yes

result:

ok single line: 'yes'

Test #14:

score: 0
Accepted
time: 1ms
memory: 3732kb

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: 1ms
memory: 3672kb

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: 1ms
memory: 3672kb

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: 0ms
memory: 3612kb

input:

5
1 2 4 8 16

output:

no

result:

ok single line: 'no'