Submission #1444999


Source Code Expand

#include <map>
#include <set>
#include <cmath>
#include <ctime>
#include <cstdio>
#include <vector>
#include <cstring>
#include <cstdlib>
#include <algorithm>

using namespace std;

#define mp make_pair
#define pb push_back
#define x first
#define y second

typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef vector<pii> vpii;

int gcd(int x,int y)
{
	while (y)
	{
		int r=x%y;x=y;y=r;
	}
	return x;
}

int main()
{
	#ifndef ONLINE_JUDGE
		//freopen("input.txt","r",stdin);
		//freopen("output.txt","w",stdout);
	#endif
	int n,k,x;scanf("%d%d%d",&n,&k,&x);
	int ma=x;
	for (int i=1;i<n;i++)
	{
		int y;scanf("%d",&y);
		x=gcd(x,y);ma=max(ma,y);
	}
	if (k%x==0&&k<=ma) puts("POSSIBLE"); else puts("IMPOSSIBLE");
	return 0;
}

Submission Info

Submission Time
Task A - Getting Difference
User SanSiroWaltz
Language C++14 (GCC 5.4.1)
Score 300
Code Size 801 Byte
Status AC
Exec Time 12 ms
Memory 128 KB

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:38:36: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
  int n,k,x;scanf("%d%d%d",&n,&k,&x);
                                    ^
./Main.cpp:42:23: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
   int y;scanf("%d",&y);
                       ^

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 4
AC × 19
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt, sample_04.txt
All 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
Case Name Status Exec Time Memory
sample_01.txt AC 0 ms 128 KB
sample_02.txt AC 0 ms 128 KB
sample_03.txt AC 0 ms 128 KB
sample_04.txt AC 0 ms 128 KB
subtask_1_01.txt AC 0 ms 128 KB
subtask_1_02.txt AC 0 ms 128 KB
subtask_1_03.txt AC 12 ms 128 KB
subtask_1_04.txt AC 12 ms 128 KB
subtask_1_05.txt AC 6 ms 128 KB
subtask_1_06.txt AC 2 ms 128 KB
subtask_1_07.txt AC 7 ms 128 KB
subtask_1_08.txt AC 11 ms 128 KB
subtask_1_09.txt AC 5 ms 128 KB
subtask_1_10.txt AC 9 ms 128 KB
subtask_1_11.txt AC 10 ms 128 KB