結果

問題 No.1219 Mancala Combo
ユーザー nmnmnmnmnmnmnmnmnmnmnmnmnmnm
提出日時 2020-09-04 21:47:40
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,169 bytes
コンパイル時間 665 ms
コンパイル使用メモリ 88,164 KB
実行使用メモリ 5,392 KB
最終ジャッジ日時 2023-08-17 15:23:03
合計ジャッジ時間 2,422 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <algorithm>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <memory>
#include <queue>
#include <deque>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <cassert>
#include <iostream>
#include <stdio.h>
#include <time.h>
 
using namespace std;

typedef long long ll;
 
#define sz size()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(c) (c).begin(), (c).end()
#define rep(i,a,b) for(int i=(a);i<(b);++i)
#define clr(a, b) memset((a), (b) ,sizeof(a))
 
#define MOD 1000000007

int main(){
  ll n;
  cin>>n;
  vector<ll> v;
  rep(i,0,n){
    ll a;
    cin>>a;
    v.pb(a);
  }
  ll flag = 1;
  if(v[0]>1)flag = 0;
  rep(i,1,v.sz){
    if(flag==1){
      if(v[i]==i+1){
        flag=2;
      }
      else if(v[i]!=i){
        flag = 0;
      }
    }
    else if(flag==2){
      if(v[i]!=0)flag = 0;
    }
  }
  if(flag!=0){
      cout << "Yes" << endl;
  }
  else{
      cout << "No" << endl;
  }
  return 0;
}
0