結果

問題 No.909 たぴの配置
ユーザー okok
提出日時 2019-10-18 21:34:55
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 57 ms / 3,000 ms
コード長 850 bytes
コンパイル時間 674 ms
コンパイル使用メモリ 81,796 KB
実行使用メモリ 6,332 KB
最終ジャッジ日時 2023-09-07 21:31:08
合計ジャッジ時間 3,791 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 54 ms
6,044 KB
testcase_06 AC 55 ms
6,276 KB
testcase_07 AC 51 ms
5,968 KB
testcase_08 AC 54 ms
6,088 KB
testcase_09 AC 57 ms
6,168 KB
testcase_10 AC 52 ms
5,960 KB
testcase_11 AC 51 ms
6,036 KB
testcase_12 AC 52 ms
6,332 KB
testcase_13 AC 54 ms
6,296 KB
testcase_14 AC 52 ms
6,032 KB
testcase_15 AC 51 ms
6,016 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

 #include<iostream>
#include<string>
#include<iomanip>
#include<cmath>
#include<vector>
#include<algorithm>

using namespace std;

#define int long long
#define endl "\n"

const long long INF = (long long)1e18;
const long long MOD = 1'000'000'007; 

string yn(bool f){return f?"Yes":"No";}
string YN(bool f){return f?"YES":"NO";}



signed main(){
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	cout<<fixed<<setprecision(10);
	
	int N;
	int minimum = INF, mini = -1;
	vector<int> X, Y;
	
	cin>>N;
	
	X.resize(N);
	Y.resize(N);
	
	for(int i = 0; i < N; i++){
		cin>>X[i];
	}
	
	for(int i = 0; i < N; i++){
		cin>>Y[i];
		
		if(minimum > X[i] + Y[i]){
			minimum = X[i] + Y[i];
			
			mini = i;
		}
	}
	
	cout<<minimum<<endl;
	
	cout<<0<<endl;
	
	for(int i = 0; i < N; i++){
		cout<<min(X[i],minimum)<<endl;
	}
	cout<<minimum<<endl;
	
	return 0;
}
 
0