Submission #1871761
Source Code Expand
#include<bits/stdc++.h>
#define sqr(x) ((x)*(x))
#define ll long long
#define ull unsigned long long
#define ui unsigned int
#define ld long double
#define vi vector<int>
#define pii pair<int,int>
#define pb push_back
#define mp make_pair
#define debuge cerr<<"isok"<<endl
#define debug(x) cerr<<#x<<"="<<x<<endl
#define SS second
#define FF first
#define ls (k<<1)
#define rs (k<<1|1)
#define inf 0x3f3f3f3f
#define clr(a,x) memset(a,x,sizeof(a))
#define cpy(a,x) memcpy(a,x,sizeof(a))
#define file(x) freopen(x".in","r",stdin),freopen(x".out","w",stdout);
using namespace std;
const int N=100005,M=100005,mod=1e9+7;
template<class T> inline void gmin(T &x,const T &y){if(x>y) x=y;}
template<class T> inline void gmax(T &x,const T &y){if(x<y) x=y;}
inline void ch(int &x,int y){x=(x+y)%mod;}
template<class T>inline void read(T &x){
x=0;char ch=getchar(),rev=0;
while(ch>'9'||ch<'0') rev=(ch=='-'),ch=getchar();
while(ch>='0'&&ch<='9') x=x*10+ch-'0',ch=getchar();
x=rev?-x:x;
}
template<class T>inline void print(T x,const char c){
if(!x){putchar('0');putchar(c);return;}
if(x<0) putchar('-'),x=-x;
int m=0,a[10];
while(x) a[m++]=x%10,x/=10;
while(m--) putchar(a[m]+'0');
putchar(c);
}
inline int exp(int x,int y){
int ans=1;
while(y){
if(y&1) ans=(ll)ans*x%mod;
x=(ll)x*x%mod;y>>=1;
}return ans;
}
int n,k,a[N];
int main(){
#ifdef rqgao2014
freopen("input.txt","r",stdin);
#endif
scanf("%d%d",&n,&k);
bool x1=0,x2=0;
for(int i=1;i<=n;i++){
scanf("%d",&a[i]);
if(a[i]>=k) x1=1;
a[1]=__gcd(a[1],a[i]);
}
if(k%a[1]==0&&x1) puts("POSSIBLE"); else puts("IMPOSSIBLE");
return 0;
}
Submission Info
Submission Time
2017-12-15 12:18:16+0900
Task
A - Getting Difference
User
rqgao2014
Language
C++14 (GCC 5.4.1)
Score
300
Code Size
1676 Byte
Status
AC
Exec Time
13 ms
Memory
640 KB
Compile Error
./Main.cpp: In function ‘int main()’:
./Main.cpp:55:21: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%d%d",&n,&k);
^
./Main.cpp:58:20: 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
Sample
All
Score / Max Score
0 / 0
300 / 300
Status
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
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
13 ms
640 KB
subtask_1_04.txt
AC
12 ms
640 KB
subtask_1_05.txt
AC
7 ms
512 KB
subtask_1_06.txt
AC
3 ms
256 KB
subtask_1_07.txt
AC
8 ms
512 KB
subtask_1_08.txt
AC
12 ms
640 KB
subtask_1_09.txt
AC
6 ms
384 KB
subtask_1_10.txt
AC
9 ms
512 KB
subtask_1_11.txt
AC
11 ms
512 KB