結果

問題 No.909 たぴの配置
ユーザー tko919tko919
提出日時 2019-10-19 16:12:51
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 63 ms / 3,000 ms
コード長 927 bytes
コンパイル時間 1,501 ms
コンパイル使用メモリ 165,540 KB
実行使用メモリ 4,860 KB
最終ジャッジ日時 2023-09-09 13:26:25
合計ジャッジ時間 5,532 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 60 ms
4,860 KB
testcase_06 AC 61 ms
4,728 KB
testcase_07 AC 57 ms
4,460 KB
testcase_08 AC 60 ms
4,540 KB
testcase_09 AC 63 ms
4,648 KB
testcase_10 AC 58 ms
4,456 KB
testcase_11 AC 57 ms
4,380 KB
testcase_12 AC 59 ms
4,604 KB
testcase_13 AC 61 ms
4,712 KB
testcase_14 AC 58 ms
4,380 KB
testcase_15 AC 57 ms
4,400 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;

//template
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(a);i>(b);i--)
#define ALL(v) (v).begin(),(v).end()
typedef long long int ll; typedef pair<ll, ll> P;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<typename A,size_t N,typename T>void Fill(A(&array)[N],const T &val){fill((T*)array, (T*)(array+N), val);}
const int inf = 0x3fffffff; const ll INF = 0x3fffffffffffffff;
//template end



int main(){
    int n; scanf("%d",&n);
    vector<int> x(n),y(n);
    rep(i,0,n)scanf("%d",&x[i]);
    rep(i,0,n)scanf("%d",&y[i]);
    int d=inf;
    rep(i,0,n)chmin(d,x[i]+y[i]);
    printf("%d %d ",d,0);
    rep(i,0,n)printf("%d ",min(x[i],d));
    printf("%d\n",d);
    return 0;
}
0