結果
問題 | No.1219 Mancala Combo |
ユーザー | Cyanmond |
提出日時 | 2020-09-04 22:55:50 |
言語 | C++14 (gcc 12.3.0 + boost 1.83.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 2,792 bytes |
コンパイル時間 | 1,338 ms |
コンパイル使用メモリ | 130,152 KB |
実行使用メモリ | 8,832 KB |
最終ジャッジ日時 | 2024-11-26 20:50:38 |
合計ジャッジ時間 | 2,857 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
5,248 KB |
testcase_01 | AC | 1 ms
5,248 KB |
testcase_02 | AC | 2 ms
5,248 KB |
testcase_03 | AC | 1 ms
5,248 KB |
testcase_04 | WA | - |
testcase_05 | AC | 1 ms
5,248 KB |
testcase_06 | WA | - |
testcase_07 | AC | 2 ms
5,248 KB |
testcase_08 | WA | - |
testcase_09 | AC | 1 ms
5,248 KB |
testcase_10 | WA | - |
testcase_11 | AC | 1 ms
5,248 KB |
testcase_12 | WA | - |
testcase_13 | AC | 1 ms
5,248 KB |
testcase_14 | AC | 1 ms
5,248 KB |
testcase_15 | AC | 1 ms
5,248 KB |
testcase_16 | WA | - |
testcase_17 | AC | 41 ms
5,248 KB |
testcase_18 | WA | - |
testcase_19 | AC | 36 ms
5,248 KB |
testcase_20 | WA | - |
testcase_21 | AC | 31 ms
5,248 KB |
testcase_22 | WA | - |
testcase_23 | AC | 50 ms
5,248 KB |
testcase_24 | WA | - |
testcase_25 | AC | 33 ms
5,248 KB |
testcase_26 | WA | - |
testcase_27 | AC | 58 ms
5,760 KB |
testcase_28 | WA | - |
ソースコード
//include,using,define等 #pragma region header #include <algorithm> #include <bitset> #include <tuple> #include <cstdint> #include <cctype> #include <assert.h> #include <stdlib.h> #include <stdio.h> #include <cassert> #include <cfloat> #include <climits> #include <cmath> #include <complex> #include <ctime> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <iterator> #include <list> #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> // =============================================================== //using系 #pragma region header using namespace std; using ll = long long; using lint = long long; using vl = vector<long long>; using vvl = vector<vector<long long>>; using vvi = vector<vector<int>>; using vs = vector<string>; using vc = vector<char>; using vcc = vector<vector<char>>; using vm = vector<short>; using vmm = vector<vector<short>>; using pii = pair<int, int>; using psi = pair<string, int>; using ld = long double; using ull = unsigned long long; using ui = unsigned int; using qul = queue<ll>; using pql = priority_queue<ll>; const int dx[] = { 1,0,-1,0 }; const int dy[] = { 0,1,0,-1 }; constexpr ll mod = 1000000007; constexpr long double pi = 3.141592653589793238462643383279; #pragma endregion // ======================================================================== //define #pragma region header #define rep(i, n) for(ll i = 0; i < n; i++) #define REP(i, n) for(ll i = 1; i <= n; i++) #define INF (ll)10000000000000000 #define mod (ll)1000000007 #pragma endregion #pragma endregion int main() { int n; cin >> n; vector<int> d(n); for (int i = 0; i < n; i++) cin >> d[i]; bool s = false; if (d[0] != 0) s = true; for (int i = 1; i < n; i++) { if (d[i] != 0) s = false; } bool susu = false; for (int i = n - 1; i > 0; i--) { if (d[i] != 0) { susu = true; if (d[i] != i + 1) { cout << "No" << endl; return 0; } break; } } if (s) { cout << "Yes" << endl; return 0; } map<int, int> mp; for (int i = 1; i < n; i++) { if (d[i] != 0) mp[(i + 1) - d[i]]++; } bool h = false; bool cnt = false; if (mp[0] == 0) { cout << "No" << endl; return 0; } if (mp[0] > 1) { cout << "No" << endl; return 0; } for (int i = 1; i < n; i++) { if (mp[i] == 0) { cnt = true; } if (mp[i] == 1) { if (cnt) { cout << "No" << endl; return 0; } } if (mp[i] > 1) { if (mp[i + 1] == 0) cnt = true; else { cout << "No" << endl; return 0; } } } if (cnt) cout << "Yes" << endl; else cout << "No" << endl; return 0; }