Submission #4282054


Source Code Expand

Copy
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<string>
#include<cstring>
#include<algorithm>
#include<queue>
#include<map>
#include<set>
using namespace std;
int n;
int a[120000];
int gcdd(int a,int b)
{
    return (a%b==0)?b:gcdd(b,a%b);
}

int main()
{
    cin>>n;
    int ans=0;
    for (int i=0; i<n; ++i)
    {
        scanf("%d",&a[i]);
        ans=(i==0)?a[0]:gcdd(ans,a[i]);
    }
    cout<<ans<<endl;
    return 0;
}

Submission Info

Submission Time
Task C - Monsters Battle Royale
User shyyhs
Language C++14 (GCC 5.4.1)
Score 300
Code Size 490 Byte
Status AC
Exec Time 13 ms
Memory 640 KB

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:25:26: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d",&a[i]);
                          ^

Judge Result

Set Name All Sample
Score / Max Score 300 / 300 0 / 0
Status
AC × 21
AC × 3
Set Name Test Cases
All 0_random_1, 0_random_2, 0_random_3, 0_random_4, 1_normal_1, 1_normal_2, 1_normal_3, 1_normal_4, 1_normal_5, 1_normal_6, 2_corner_1, 2_corner_2, 2_corner_3, 2_corner_4, 2_corner_5, 2_corner_6, 2_corner_7, 2_corner_8, sample_01, sample_02, sample_03
Sample sample_01, sample_02, sample_03
Case Name Status Exec Time Memory
0_random_1 AC 8 ms 512 KB
0_random_2 AC 13 ms 640 KB
0_random_3 AC 1 ms 256 KB
0_random_4 AC 1 ms 256 KB
1_normal_1 AC 4 ms 384 KB
1_normal_2 AC 9 ms 512 KB
1_normal_3 AC 13 ms 640 KB
1_normal_4 AC 13 ms 640 KB
1_normal_5 AC 1 ms 256 KB
1_normal_6 AC 1 ms 256 KB
2_corner_1 AC 12 ms 640 KB
2_corner_2 AC 13 ms 640 KB
2_corner_3 AC 1 ms 256 KB
2_corner_4 AC 13 ms 640 KB
2_corner_5 AC 13 ms 640 KB
2_corner_6 AC 4 ms 384 KB
2_corner_7 AC 5 ms 384 KB
2_corner_8 AC 6 ms 384 KB
sample_01 AC 1 ms 256 KB
sample_02 AC 1 ms 256 KB
sample_03 AC 1 ms 256 KB