結果

問題 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,675 ms
コンパイル使用メモリ 168,032 KB
実行使用メモリ 55,256 KB
最終ジャッジ日時 2023-08-17 17:14:48
合計ジャッジ時間 5,924 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 20 ms
49,776 KB
testcase_01 AC 20 ms
49,920 KB
testcase_02 AC 20 ms
49,864 KB
testcase_03 AC 21 ms
49,752 KB
testcase_04 AC 22 ms
49,868 KB
testcase_05 AC 21 ms
49,804 KB
testcase_06 AC 21 ms
49,860 KB
testcase_07 AC 21 ms
49,748 KB
testcase_08 AC 21 ms
49,808 KB
testcase_09 AC 20 ms
49,688 KB
testcase_10 AC 20 ms
49,900 KB
testcase_11 AC 21 ms
49,820 KB
testcase_12 AC 21 ms
49,856 KB
testcase_13 AC 21 ms
49,640 KB
testcase_14 AC 20 ms
49,896 KB
testcase_15 AC 21 ms
49,800 KB
testcase_16 AC 20 ms
49,784 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