提出 #71494598


ソースコード 拡げる

//#include<stdio.h>
#include<iostream>
#include<vector>
#include<algorithm>
#include <stdlib.h>
#include<string>
#include<math.h>
#include<sstream>
#include<set>
#include<math.h>
#include <algorithm>
#include<map>
#include <numeric>
#include <sstream>
#include <iomanip>
#include<tuple>
#include <bitset>
#include <queue>
#include <iomanip>
#include <stack>
#include<time.h>
#include <unordered_set>
#include <random>
using namespace::std;
#define RANDMAX  100000
#define ll long long 
#define lint long long int
#define ldouble long double
#define ALL(a)  (a).begin(),(a).end()
using ve = vector<lint>;

vector<vector<int>> map2;
//
using Gra = vector<vector<lint>>;
using sve = vector<string>;
//  


//cout << std::fixed << std::setprecision(15)<< ans;//小数点
//

// 
//<stack>//上から
// box.push()
// box.pop()
// box.top()
// 
// <queue>下から
// box.push()
// box.front()
// box.pop()
// 
// <set>
// ite=g2.lower_bound(r) set二部探索
// distance(ls.begin(), ite);探索した後の引数
// advance() は極力使わないこと!! ***************************************
// g2.count() set()内の個数
// lower_bound(a.begin(),a.end(),a[i])
// box.size()
// 
// <vector>
// vector<int>
// lower_bound(a.begin(),a.end(),a[i])
// vector<vector<lint>> v(2, vector<lint>(3)) -> v.at(1).at(2);
// next_permutation(aaa.begin(), aaa.end()) ベクターの組み合わせ
//
//<2分探索 ~手動実装偏~>
// int binary_search(int key) {
//    int left = 0, right = (int)a.size() - 1; // 配列 a の左端と右端
//    while (right >= left) {
//        int mid = left + (right - left) / 2; // 区間の真ん中
//        if (a[mid] == key) return mid;
//        else if (a[mid] > key) right = mid - 1;
//        else if (a[mid] < key) left = mid + 1;
//    }
//    return -1;
// }
// 
// <bit全探索>
// bitset<60> bs(n);
//
//鶏をswapするときは箱の番号を変える






/*	par=time_check(nh, nm);
    nh = par.first; nm = par.second;*/
pair<lint, lint> time_check(int h, int m) {
    while (m >= 60) {
        h += 1;
        m -= 60;
    }
    while (m < 0) {
        h -= 1;
        m += 60;
    }
    return make_pair(h, m);
}


std::random_device seed_gen;
uint32_t get_rand() {
    // 乱数生成器(引数にシードを指定可能)
    static std::mt19937 mt32(seed_gen());

    // [0, (2^32)-1] の一様分布整数を生成
    return mt32();
}

class ansd {
public:
    int p;
    int x;
    int y;
};

class zahyo {
public:
    int x;
    int y;
};


int main() {
    lint n,now=1,dai=0;
    cin >> n;
    ve a(n);
    for (lint i = 0; i < n; i++) {
        cin >> a[i];
    }
    dai = a[0];
    while (1) {
        dai--;
        if (dai == 0)break;
        if (now == n)break;
        if (dai + now - 1 < a[now] + now - 1)dai = a[now];
        now++;
    }
    cout << now;
}

提出情報

提出日時
問題 C - Domino
ユーザ tbbt95
言語 C++23 (GCC 15.2.0)
得点 300
コード長 2988 Byte
結果 AC
実行時間 89 ms
メモリ 7408 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 300 / 300
結果
AC × 3
AC × 20
セット名 テストケース
Sample sample_01.txt, sample_02.txt, sample_03.txt
All min.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt, random_15.txt, random_16.txt, sample_01.txt, sample_02.txt, sample_03.txt
ケース名 結果 実行時間 メモリ
min.txt AC 1 ms 3560 KiB
random_01.txt AC 86 ms 7332 KiB
random_02.txt AC 32 ms 4872 KiB
random_03.txt AC 86 ms 7368 KiB
random_04.txt AC 16 ms 3988 KiB
random_05.txt AC 83 ms 7296 KiB
random_06.txt AC 82 ms 7148 KiB
random_07.txt AC 84 ms 7356 KiB
random_08.txt AC 45 ms 5528 KiB
random_09.txt AC 83 ms 7320 KiB
random_10.txt AC 65 ms 6400 KiB
random_11.txt AC 83 ms 7264 KiB
random_12.txt AC 23 ms 4500 KiB
random_13.txt AC 42 ms 7352 KiB
random_14.txt AC 89 ms 7304 KiB
random_15.txt AC 87 ms 7408 KiB
random_16.txt AC 87 ms 7368 KiB
sample_01.txt AC 1 ms 3656 KiB
sample_02.txt AC 1 ms 3592 KiB
sample_03.txt AC 1 ms 3524 KiB