提出 #71487993


ソースコード 拡げる

#include <iostream>
#include <algorithm>
#include <deque>
#include <vector>
#include <queue>
#include <cmath>
using namespace std;

int n;
int a[500001];

int main() {
	ios::sync_with_stdio(false);
	cin.tie(NULL);

	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}
	int x = a[0];
	int idx = 1;
	int i;
	for (i = 1; i < n; i++) {
		if (--x == 0) break;
		if (x < a[i]) x = a[i];
	}
	cout << i;
}

提出情報

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

コンパイルエラー

./Main.cpp: In function 'int main()':
./Main.cpp:21:13: warning: unused variable 'idx' [-Wunused-variable]
   21 |         int idx = 1;
      |             ^~~

ジャッジ結果

セット名 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 3728 KiB
random_01.txt AC 16 ms 5576 KiB
random_02.txt AC 7 ms 4364 KiB
random_03.txt AC 18 ms 5704 KiB
random_04.txt AC 4 ms 3972 KiB
random_05.txt AC 16 ms 5628 KiB
random_06.txt AC 15 ms 5488 KiB
random_07.txt AC 16 ms 5704 KiB
random_08.txt AC 9 ms 4680 KiB
random_09.txt AC 16 ms 5704 KiB
random_10.txt AC 13 ms 5192 KiB
random_11.txt AC 16 ms 5568 KiB
random_12.txt AC 5 ms 4228 KiB
random_13.txt AC 11 ms 5616 KiB
random_14.txt AC 15 ms 5604 KiB
random_15.txt AC 15 ms 5776 KiB
random_16.txt AC 15 ms 5584 KiB
sample_01.txt AC 1 ms 3528 KiB
sample_02.txt AC 1 ms 3504 KiB
sample_03.txt AC 1 ms 3616 KiB