結果

問題 No.909 たぴの配置
ユーザー ojisan_ITojisan_IT
提出日時 2019-11-26 20:12:03
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 399 ms / 3,000 ms
コード長 1,295 bytes
コンパイル時間 1,700 ms
コンパイル使用メモリ 163,216 KB
実行使用メモリ 6,656 KB
最終ジャッジ日時 2024-04-24 16:14:22
合計ジャッジ時間 8,779 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 1 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 387 ms
6,656 KB
testcase_06 AC 399 ms
6,656 KB
testcase_07 AC 365 ms
6,528 KB
testcase_08 AC 382 ms
6,656 KB
testcase_09 AC 399 ms
6,656 KB
testcase_10 AC 363 ms
6,528 KB
testcase_11 AC 360 ms
6,400 KB
testcase_12 AC 375 ms
6,656 KB
testcase_13 AC 394 ms
6,528 KB
testcase_14 AC 366 ms
6,528 KB
testcase_15 AC 359 ms
6,272 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
template<class T> using vt = vector<T>;
template<class T> using vvt = vector<vt<T>>;
template<class T> using ttt = tuple<T,T>;
using tii = tuple<int,int>;
using tiii = tuple<int,int,int>;
using vi = vector<int>;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define pb push_back
#define mt make_tuple
#define ALL(a) (a).begin(),(a).end()
#define FST first
#define SEC second
#define DEB cerr<<"!"<<endl
#define SHOW(a,b) cerr<<(a)<<" "<<(b)<<endl
const int INF = (INT_MAX/2);
const ll LLINF = (LLONG_MAX/2);
const double eps = 1e-8;
const ll DIV =1e9+7;
//const double PI = M_PI;
inline ll pow(ll x,ll n,ll m){ll r=1;while(n>0){if((n&1)==1)r=r*x%m;x=x*x%m;n>>=1;}return r%m;}
inline ll lcm(ll d1, ll d2){return d1 / __gcd(d1, d2) * d2;}
#define chmax(a,b) a=max(a,b)

/*Coding Space*/
ll x[1000000];
ll y[1000000];
int main(){
  int n; cin >> n; rep(i,n)cin >> x[i]; rep(i,n) cin >> y[i];

  ll ans = LLINF; rep(i,n) ans =min(ans, x[i] + y[i]);

  cout << ans << endl;
  cout << 0 + DIV << endl;
  rep(i,n){
    if(x[i] + y[i] == ans)  cout << x[i] + DIV << endl;
    else{
      if(x[i] > y[i]){
        cout << ans - y[i] + DIV << endl;
      }else{
        cout << x[i] + DIV << endl;
      }
    }
  }
  cout << ans + DIV;
}
0