結果

問題 No.909 たぴの配置
ユーザー KKT89KKT89
提出日時 2019-10-18 21:39:18
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 299 ms / 3,000 ms
コード長 602 bytes
コンパイル時間 640 ms
コンパイル使用メモリ 78,212 KB
実行使用メモリ 5,508 KB
最終ジャッジ日時 2023-09-07 21:39:12
合計ジャッジ時間 6,376 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 1 ms
4,384 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,384 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 287 ms
5,348 KB
testcase_06 AC 299 ms
5,360 KB
testcase_07 AC 273 ms
5,092 KB
testcase_08 AC 289 ms
5,508 KB
testcase_09 AC 298 ms
5,416 KB
testcase_10 AC 275 ms
5,380 KB
testcase_11 AC 269 ms
5,128 KB
testcase_12 AC 284 ms
5,352 KB
testcase_13 AC 295 ms
5,420 KB
testcase_14 AC 271 ms
5,124 KB
testcase_15 AC 269 ms
5,236 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <queue>
#include <stack>
using namespace std;
typedef long long int ll;

int tapi[210010];

int main(){
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	int n; cin >> n;
	vector<int> x(n),y(n);
	for(int i=0;i<n;i++){
		cin >> x[i];
	}
	for(int i=0;i<n;i++){
		cin >> y[i];
	}
	tapi[0]=0;
	for(int i=0;i<n;i++){
		tapi[i+1]=x[i];
	}
	int tapu=1e9;
	for(int i=0;i<n;i++){
		tapu=min(tapi[i+1]+y[i],tapu);
	}
	cout << tapu << endl;
	for(int i=0;i<=n;i++){
		cout << min(tapi[i],tapu) << endl;
	}
	cout << tapu << endl;
}
0