結果

問題 No.909 たぴの配置
ユーザー Kaso_uKaso_u
提出日時 2019-10-18 23:47:29
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 727 bytes
コンパイル時間 1,578 ms
コンパイル使用メモリ 166,556 KB
実行使用メモリ 4,868 KB
最終ジャッジ日時 2023-09-08 02:54:52
合計ジャッジ時間 9,792 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 1 ms
4,376 KB
testcase_02 WA -
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 342 ms
4,580 KB
testcase_15 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;

int main(){
  int N;
  cin >> N;
  //vector<ll int> zahyou(N+2);
  vector<int> X(N);
  vector<int> Y(N);
  int saishou=0, flag=0;
  int num=0;
  
  for(int i=0;i<N;i++){
    cin >> X.at(i);
  }
  for(int i=0;i<N;i++){
    cin >> Y.at(i);
  }
  
  for(int i=0;i<N-1;i++){
    saishou = min(Y.at(i), Y.at(i+1));
  }
  
  for(int i=0;i<N;i++){
    if(saishou==Y.at(i)){
      num = i;
      break;
    }
  }
  
  cout << Y.at(num)+X.at(num) << endl;
  
  for(int i=0;i<N+2;i++){
    if(i==0){
      cout << 0 << endl;
    }
    else if(i==N+1){
      cout << Y.at(num)+X.at(num) << endl;
    }
    else{
      cout << X.at(i-1) << endl;
    }
  }  
  return 0;
}
0