AtCoder Grand Contest 018

Submission #6384585

Source codeソースコード

#include<bits/stdc++.h>
#include<iostream>
#define ll long long
#define back return
using namespace std;
ll n,m,i,j,k,lsbl,sum,sumend;
ll gcd(ll a,ll b)
{
    if(!b)
        back a;
    back gcd(b,a%b);
}
ll maxx(ll a,ll b)
{
    if(a>=b)
        back a;
    back b;
}
int main()
{
    cin>>n>>m>>k;
    ll lsbl1=k;
    for(i=2;i<=n;i++)
    {
        cin>>lsbl;
        k=gcd(k,lsbl);
        lsbl1=maxx(lsbl,lsbl1);
    }
    if(lsbl1>=m&&!(m%k))
    {
        cout<<"POSSIBLE"<<endl;
        back 0;
    }
    cout<<"IMPOSSIBLE"<<endl;
    back 0;
}

Submission

Task問題 A - Getting Difference
User nameユーザ名 luogu_bot4
Created time投稿日時
Language言語 C++14 (GCC 5.4.1)
Status状態 AC
Score得点 300
Source lengthソースコード長 587 Byte
File nameファイル名
Exec time実行時間 42 ms
Memory usageメモリ使用量 256 KB

Test case

Set

Set name Score得点 / Max score Cases
Sample - sample_01.txt,sample_02.txt,sample_03.txt,sample_04.txt
All 300 / 300 sample_01.txt,sample_02.txt,sample_03.txt,sample_04.txt,sample_01.txt,sample_02.txt,sample_03.txt,sample_04.txt,subtask_1_01.txt,subtask_1_02.txt,subtask_1_03.txt,subtask_1_04.txt,subtask_1_05.txt,subtask_1_06.txt,subtask_1_07.txt,subtask_1_08.txt,subtask_1_09.txt,subtask_1_10.txt,subtask_1_11.txt

Test case

Case name Status状態 Exec time実行時間 Memory usageメモリ使用量
sample_01.txt AC 1 ms 256 KB
sample_02.txt AC 1 ms 256 KB
sample_03.txt AC 1 ms 256 KB
sample_04.txt AC 1 ms 256 KB
subtask_1_01.txt AC 1 ms 256 KB
subtask_1_02.txt AC 1 ms 256 KB
subtask_1_03.txt AC 42 ms 256 KB
subtask_1_04.txt AC 41 ms 256 KB
subtask_1_05.txt AC 22 ms 256 KB
subtask_1_06.txt AC 7 ms 256 KB
subtask_1_07.txt AC 26 ms 256 KB
subtask_1_08.txt AC 37 ms 256 KB
subtask_1_09.txt AC 18 ms 256 KB
subtask_1_10.txt AC 31 ms 256 KB
subtask_1_11.txt AC 34 ms 256 KB