結果

問題 No.1734 Decreasing Elements
ユーザー 👑 platinumplatinum
提出日時 2021-08-17 14:19:30
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 477 bytes
コンパイル時間 2,179 ms
コンパイル使用メモリ 194,556 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-04-24 04:51:06
合計ジャッジ時間 7,795 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
9,216 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 2 ms
5,376 KB
testcase_08 AC 2 ms
5,376 KB
testcase_09 AC 3 ms
5,376 KB
testcase_10 AC 3 ms
5,376 KB
testcase_11 AC 41 ms
5,376 KB
testcase_12 AC 25 ms
5,376 KB
testcase_13 AC 43 ms
5,376 KB
testcase_14 AC 98 ms
5,376 KB
testcase_15 AC 58 ms
5,376 KB
testcase_16 AC 96 ms
5,376 KB
testcase_17 AC 114 ms
5,376 KB
testcase_18 AC 113 ms
5,376 KB
testcase_19 TLE -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (int)(n); i++)

using namespace std;
using LL = long long;
using P = pair<int,int>;
using vv = vector<vector<int>>;
const int INF = (int)1e9;
const LL LINF = (LL)1e18;

int main(){
	int N;
	cin >> N;
	vector<int> A(N);
	rep(i,N) cin >> A[i];
	int ans = 0;
	rep(i,N){
		int a = A[i];
		if(a == 0) continue;
		ans++;
		for(int j = i; j < N; j++){
			if(A[j] >= a) A[j] -= a;
		}
	}
	cout << ans << endl;

	return 0;
}
0