結果

問題 No.1219 Mancala Combo
ユーザー uw_yu1rabbituw_yu1rabbit
提出日時 2020-09-04 21:36:47
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 846 bytes
コンパイル時間 852 ms
コンパイル使用メモリ 79,004 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-05-04 21:48:12
合計ジャッジ時間 1,811 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 WA -
testcase_05 AC 1 ms
5,376 KB
testcase_06 WA -
testcase_07 AC 2 ms
5,376 KB
testcase_08 WA -
testcase_09 AC 1 ms
5,376 KB
testcase_10 AC 1 ms
5,376 KB
testcase_11 AC 2 ms
5,376 KB
testcase_12 WA -
testcase_13 AC 1 ms
5,376 KB
testcase_14 AC 2 ms
5,376 KB
testcase_15 AC 1 ms
5,376 KB
testcase_16 AC 2 ms
5,376 KB
testcase_17 AC 13 ms
5,376 KB
testcase_18 WA -
testcase_19 AC 12 ms
5,376 KB
testcase_20 WA -
testcase_21 AC 10 ms
5,376 KB
testcase_22 WA -
testcase_23 AC 18 ms
5,376 KB
testcase_24 WA -
testcase_25 AC 12 ms
5,376 KB
testcase_26 WA -
testcase_27 AC 18 ms
5,376 KB
testcase_28 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include<iostream>
#include<vector>
#include<cstdint>
#include<cstddef>
using namespace std;
using i32 = int_fast32_t;
using i64 = int_fast64_t;
using usize = size_t;
#define rep(i, n) for (usize i = 0; i < (usize)(n); i++)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
using P = pair<i64,i64>;

int main(){
ios::sync_with_stdio(false);
std::cin.tie(nullptr);
usize n;
cin >> n;
vector<usize> a(n);
i64 right = 0;
i64 stone_exists = 0;
rep(i,n){
    cin >> a[i];
    if(a[i] == i + 1)right = i + 1;
    if(a[i] != 0)stone_exists = i + 1;
}
usize cnt = 0;
rep(i,n){
    if(a[i] >= i + 1 && i != 0){
        cnt++;
    }
}
if(cnt >= 2 || right != stone_exists){
    cout << "No" << endl;
}
else{
    cout << "Yes" << endl;
}
}
0