Submission #4280850


Source Code Expand

Copy
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <math.h>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <math.h>
#include <iostream>
#include <random>
#include <map>
#include <fstream>
#include <iomanip>
#include <time.h>
#include <stdlib.h>
#include <list>
#include <typeinfo>
#include <list>
#include <set>
#include <assert.h>
#include <complex>
using namespace std;
#define eps 0.000001
#define LONG_INF 10000000
#define GOLD 1.61803398874989484820458
#define MAX_MOD 1000000007
#define MOD 998244353
#define seg_size 65536*16
#define REP(i,n) for(long long i = 0;i < n;++i)
long long gcd(long long a, long long b) {
	if (b == 0) return a;
	return gcd(b, a%b);
}
int main() {
	int n;
	cin >> n;
	long long ans = 0;
	cin >> ans;
	REP(i, n - 1) {
		long long geko;
		cin >> geko;
		ans = gcd(ans, geko);
	}
	cout << ans << endl;
	return 0;
}

Submission Info

Submission Time
Task C - Monsters Battle Royale
User kotamanegi
Language C++14 (GCC 5.4.1)
Score 300
Code Size 1053 Byte
Status AC
Exec Time 42 ms
Memory 256 KB

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 26 ms 256 KB
0_random_2 AC 42 ms 256 KB
0_random_3 AC 1 ms 256 KB
0_random_4 AC 1 ms 256 KB
1_normal_1 AC 10 ms 256 KB
1_normal_2 AC 29 ms 256 KB
1_normal_3 AC 42 ms 256 KB
1_normal_4 AC 42 ms 256 KB
1_normal_5 AC 1 ms 256 KB
1_normal_6 AC 1 ms 256 KB
2_corner_1 AC 39 ms 256 KB
2_corner_2 AC 41 ms 256 KB
2_corner_3 AC 1 ms 256 KB
2_corner_4 AC 41 ms 256 KB
2_corner_5 AC 42 ms 256 KB
2_corner_6 AC 10 ms 256 KB
2_corner_7 AC 11 ms 256 KB
2_corner_8 AC 16 ms 256 KB
sample_01 AC 1 ms 256 KB
sample_02 AC 1 ms 256 KB
sample_03 AC 1 ms 256 KB