結果

問題 No.1219 Mancala Combo
ユーザー naribownaribow
提出日時 2020-09-04 22:30:11
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 1,075 bytes
コンパイル時間 1,752 ms
コンパイル使用メモリ 169,600 KB
実行使用メモリ 56,192 KB
最終ジャッジ日時 2024-05-04 23:56:09
合計ジャッジ時間 5,938 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 21 ms
55,680 KB
testcase_01 AC 22 ms
50,048 KB
testcase_02 AC 21 ms
50,048 KB
testcase_03 AC 21 ms
50,084 KB
testcase_04 AC 21 ms
50,048 KB
testcase_05 AC 21 ms
50,176 KB
testcase_06 AC 22 ms
50,060 KB
testcase_07 AC 22 ms
50,048 KB
testcase_08 AC 22 ms
50,048 KB
testcase_09 AC 21 ms
50,048 KB
testcase_10 AC 21 ms
50,048 KB
testcase_11 AC 21 ms
50,048 KB
testcase_12 AC 21 ms
50,080 KB
testcase_13 AC 21 ms
50,304 KB
testcase_14 AC 22 ms
50,176 KB
testcase_15 AC 21 ms
50,056 KB
testcase_16 AC 20 ms
50,064 KB
testcase_17 TLE -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const double pi=3.141592653589793;
typedef unsigned long long ull;
typedef long double ldouble;
const ll INF=1e18;
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define rep2(i, s, n) for (ll i = (s); i < (ll)(n); i++)
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

vector<vector<int> > c(2*10e5+1);

void solve(int x, int y) {

}

int main(){
  int n;
  cin >> n;
  vector<int> a(n+1);
  
  rep(i, n){
    cin >> a[i+1];
  }
  
  while(true){
    bool ok = false;
    bool end = true;
    rep2(i, 1, n+1){
      if(a[i] == i) {
        rep2(j, 1, i) {
          a[j]++;
        }
        a[i] = 0;
        ok = true;
        break;
      }
      else if(end && a[i] != 0) {
        end = false;
      }
    }
    if(!ok && end) {
      cout << "Yes" << endl;
      return 0;
    }
    else if(!ok && !end) {
      cout << "No" << endl;
      return 0;
    }
  }
}
0