結果
問題 |
No.909 たぴの配置
|
ユーザー |
![]() |
提出日時 | 2019-10-19 00:13:55 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 841 bytes |
コンパイル時間 | 1,821 ms |
コンパイル使用メモリ | 168,888 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-06-25 20:08:18 |
合計ジャッジ時間 | 9,602 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 1 |
other | AC * 3 WA * 10 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define int long long #define REP(i,n) for(int i = 0;i < (int)(n);i++) #define RREP(i,n) for(int i = (int)n-1;i >= 0;i--) #define FOR(i,s,n) for(int i = s;i < (int)n;i++) #define RFOR(i,s,n) for(int i = (int)n-1;i >= s;i--) #define ALL(a) a.begin(),a.end() template<class T>inline bool CHMAX(T&a,T b){if(a<b){a = b;return true;}return false;} template<class T>inline bool CHMIN(T&a,T b){if(a>b){a = b;return true;}return false;} constexpr long long INF = 1e18; signed main(){ int N; cin>>N; vector<int>tapi(N,INF); REP(i,N){ int t; cin >> t; CHMIN(tapi[i],t); } int end = INF; vector<int>y(N); REP(i,N){ cin>>y[i]; CHMIN(end,tapi[i]+y[i]); } REP(i,N){ CHMIN(tapi[i],end-y[i]); } cout<<end<<endl; cout<<0<<endl; for(auto &e:tapi)cout << e << endl; cout<<end<<endl; }