Submission #1445303
Source Code Expand
#include <string.h> #include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> // #include <unordered_map> // #include <unordered_set> #include <utility> #include <vector> #define pb push_back #define mp make_pair #ifdef ONLINE_JUDGE #define link renamelink #define next renamenext #define prev renameprev #endif using namespace std; typedef long long LL; typedef unsigned long long ULL; typedef pair<int, int> pii; typedef pair<LL, LL> pll; typedef long double ld; inline void EnableFileIO(const string& fileName, bool local = 0) { if (fileName.empty()) return; if (local) { freopen((fileName + ".in").c_str(), "r", stdin); freopen((fileName + ".out").c_str(), "w", stdout); return; } #ifdef ONLINE_JUDGE freopen((fileName + ".in").c_str(), "r", stdin); freopen((fileName + ".out").c_str(), "w", stdout); #endif } const int INF = (1 << 30) - 1; const LL LINF = (1LL << 61) - 1; const double EPS = 1e-10, PI = acos(-1); int n, k; int main() { // srand((int)time(0)); // printf("Hello, world!\n"); // EnableFileIO(""); cin >> n >> k; int g; int mxv = 0; for (int i = 0, a; i < n; i++) { cin >> a; if (!i) { g = a; } else { g = __gcd(a, g); } mxv = max(mxv, g); } if (k % g == 0 && k <= mxv) { cout << "POSSIBLE" << endl; } else { cout << "IMPOSSIBLE" << endl; } return 0; }
Submission Info
Submission Time | |
---|---|
Task | A - Getting Difference |
User | zyd_qinding_ntt |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 1758 Byte |
Status | WA |
Exec Time | 55 ms |
Memory | 256 KB |
Judge Result
Set Name | Sample | All | ||||||
---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 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 | WA | 53 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 | WA | 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 | WA | 22 ms | 256 KB |
subtask_1_10.txt | AC | 38 ms | 256 KB |
subtask_1_11.txt | AC | 43 ms | 256 KB |