結果
問題 |
No.1242 高橋君とすごろく
|
ユーザー |
|
提出日時 | 2020-10-02 21:36:51 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,223 bytes |
コンパイル時間 | 1,196 ms |
コンパイル使用メモリ | 125,100 KB |
実行使用メモリ | 120,988 KB |
最終ジャッジ日時 | 2024-07-16 04:29:11 |
合計ジャッジ時間 | 4,766 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 WA * 1 |
other | AC * 5 WA * 1 TLE * 1 -- * 17 |
ソースコード
#include <algorithm> #include <bitset> #include <tuple> #include <cstdint> #include <cctype> #include <assert.h> #include <time.h> #include <stdlib.h> #include <stdio.h> #include <cassert> #include <cfloat> #include <climits> #include <cmath> #include <complex> #include <ctime> #include <deque> #include <fstream> #include <iomanip> #include <iostream> #include <iterator> #include <limits> #include <map> #include <memory> #include <queue> #include <random> #include <set> #include <stack> #include <string> #include <unordered_map> #include <unordered_set> #include <utility> #include <vector> #include <math.h> #include <cstring> #include <array> using namespace std; using lint = long long; const int dx[] = { 1,0,-1,0 }; const int dy[] = { 0,1,0,-1 }; const lint INF = 1ll << 60; const int mod = 1000000007; void speed() { std::cin.tie(nullptr); std::ios::sync_with_stdio(false); return; } int main(void) { speed(); lint n; cin >> n; int k; cin >> k; map<lint, bool> r; for (int i = 0; i < k; i++) { lint s; cin >> s; r[s] = true; } for (auto s : r) { for (int i = 1; i <= min(6ll, n - s.first); i++) { if (r[s.first + i]) { puts("No"); return 0; } } } puts("Yes"); return 0; }