Submission #1446767
Source Code Expand
#include <bits/stdc++.h> #define PI acos(-1) #define mp make_pair #define fi first #define se second #define pb push_back #define endl '\n' #define io ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0); #define file freopen ("maxflow.in", "r", stdin),freopen ("maxflow.out", "w", stdout); #define all(v) ((v).begin()), ((v).end()) using namespace std; typedef pair<int, int> pii; typedef long long ll; typedef unsigned long long ull; typedef pair<ll, int> pli; int n, k; int main() { //#ifndef ONLINE_JUDGE //freopen ("in.txt", "r", stdin); //#endif cin >> n >> k; int g = 0, good = 0, mx = 0; for(int i = 0; i < n; i++) { int t; cin >> t; good |= t == k; mx = max(mx, t); g = __gcd(g, t); } if((k % g == 0 && k <= mx) || good) { cout << "POSSIBLE\n"; }else { cout << "IMPOSSIBLE\n"; } return 0; }
Submission Info
Submission Time | |
---|---|
Task | A - Getting Difference |
User | omarkhaledd |
Language | C++14 (GCC 5.4.1) |
Score | 300 |
Code Size | 892 Byte |
Status | AC |
Exec Time | 55 ms |
Memory | 384 KB |
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 | 54 ms | 256 KB |
subtask_1_04.txt | AC | 55 ms | 256 KB |
subtask_1_05.txt | AC | 29 ms | 256 KB |
subtask_1_06.txt | AC | 9 ms | 256 KB |
subtask_1_07.txt | AC | 32 ms | 256 KB |
subtask_1_08.txt | AC | 47 ms | 256 KB |
subtask_1_09.txt | AC | 22 ms | 256 KB |
subtask_1_10.txt | AC | 39 ms | 384 KB |
subtask_1_11.txt | AC | 42 ms | 256 KB |