結果
問題 | No.532 Possible or Impossible |
ユーザー |
|
提出日時 | 2017-06-23 23:12:57 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 1,644 bytes |
コンパイル時間 | 1,043 ms |
コンパイル使用メモリ | 112,792 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-03 03:34:50 |
合計ジャッジ時間 | 1,804 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 23 |
ソースコード
#include "iostream"#include "climits"#include "list"#include "queue"#include "stack"#include "set"#include "functional"#include "algorithm"#include "math.h"#include "utility"#include "string"#include "map"#include "unordered_map"#include "iomanip"#include "random"using namespace std;const long long int MOD = 1000000007;list<long long int> Prime(int M) {list<long long int>P;P.push_back(2);P.push_back(3);for (int i = 5; i <= M; i += 6) {bool flag = true;for (auto j : P) {if (i%j == 0) {flag = false;break;}}if (flag)P.push_back(i);flag = true;for (auto j : P) {if ((i + 2) % j == 0) {flag = false;break;}}if (flag)P.push_back(i + 2);}return P;}long long int power(long long int x, long long int n, long long int M) {long long int tmp = 1;if (n > 0) {tmp = power(x, n / 2, M);if (n % 2 == 0) tmp = (tmp*tmp) % M;else tmp = (((tmp*tmp) % M)*x) % M;}return tmp;}long long int N, M, K, Q, W, H;long long int ans;int main() {ios::sync_with_stdio(false);cin >> N >> M;string yes = "Possible";string no = "Impossible";if (N == 1) {if (M == 1) {cout << yes << endl;return 0;}cout << no << endl;return 0;}if (N == 2) {if (M&&M < 4) {cout << yes << endl;return 0;}cout << no << endl;return 0;}if (N == 3) {if (M < 10) {cout << yes << endl;return 0;}cout << no << endl;return 0;}if (N == 4) {if (M < 29 || M == 30 || M == 32 || M == 36) {cout << yes << endl;return 0;}cout << no << endl;return 0;}cout << yes << endl;return 0;}