Submission #1967366


Source Code Expand

Copy
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<math.h>
#include<string>
#include<string.h>
#include<stack>
#include<queue>
#include<vector>
#include<utility>
#include<set>
#include<map>
#include<stdlib.h>
#include<iomanip>

using namespace std;

#define ll long long
#define ld long double
#define EPS 0.0000000001
#define INF 1e9
#define MOD 1000000007
#define rep(i,n) for(i=0;i<n;i++)
#define loop(i,a,n) for(i=a;i<n;i++)
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)

typedef vector<int> vi;
typedef pair<int,int> pii;

int main(void) {
  int i,j;
  int n,k;
  cin>>n>>k;
  vi a(n);
  rep(i,n)cin>>a[i];
  int m=0;
  rep(i,n)m=max(m,a[i]);
  if(m<k){
    cout<<"IMPOSSIBLE"<<endl;
    return 0;
  }
  int g=a[0];
  rep(i,n)g=__gcd(g,a[i]);
  if(k%g==0)
    cout<<"POSSIBLE"<<endl;
  else
    cout<<"IMPOSSIBLE"<<endl;
}

Submission Info

Submission Time
Task A - Getting Difference
User rika0384
Language C++14 (GCC 5.4.1)
Score 300
Code Size 938 Byte
Status
Exec Time 41 ms
Memory 640 KB

Test Cases

Set Name Score / Max Score Test Cases
Sample 0 / 0 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
Case Name Status Exec Time Memory
sample_01.txt 1 ms 256 KB
sample_02.txt 1 ms 256 KB
sample_03.txt 1 ms 256 KB
sample_04.txt 1 ms 256 KB
subtask_1_01.txt 1 ms 256 KB
subtask_1_02.txt 1 ms 256 KB
subtask_1_03.txt 41 ms 640 KB
subtask_1_04.txt 41 ms 640 KB
subtask_1_05.txt 22 ms 512 KB
subtask_1_06.txt 7 ms 256 KB
subtask_1_07.txt 25 ms 512 KB
subtask_1_08.txt 35 ms 640 KB
subtask_1_09.txt 17 ms 384 KB
subtask_1_10.txt 30 ms 512 KB
subtask_1_11.txt 32 ms 512 KB