結果

問題 No.318 学学学学学
ユーザー tempura_pptempura_pp
提出日時 2018-07-17 19:08:47
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 788 bytes
コンパイル時間 700 ms
コンパイル使用メモリ 90,120 KB
実行使用メモリ 4,404 KB
最終ジャッジ日時 2023-08-17 10:23:25
合計ジャッジ時間 4,494 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 48 ms
4,376 KB
testcase_08 AC 48 ms
4,380 KB
testcase_09 AC 48 ms
4,380 KB
testcase_10 AC 48 ms
4,380 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 36 ms
4,380 KB
testcase_18 WA -
testcase_19 AC 36 ms
4,380 KB
testcase_20 WA -
testcase_21 AC 1 ms
4,376 KB
testcase_22 AC 1 ms
4,376 KB
testcase_23 AC 1 ms
4,380 KB
testcase_24 AC 2 ms
4,376 KB
testcase_25 AC 2 ms
4,380 KB
testcase_26 AC 1 ms
4,376 KB
testcase_27 AC 2 ms
4,380 KB
testcase_28 AC 2 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<map>
#include<unordered_map>
#include<set>
#include<bitset>
using namespace std;
#define REP(i,m,n) for(int i=(int)m ; i < (int) n ; i++ )
#define rep(i,n) REP(i,0,n)
typedef long long ll;
typedef pair<int,int> pint;
typedef pair<ll,int> pli;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;
const ll mod2=1e9+9 ;
int dx[4]={1,0,-1,0} , dy[4]={0,1,0,-1} ;

int main(){
  int n;cin>>n;
  int a[n],b[n];
  rep(i,n){
    cin>>a[i];
    b[i]=a[i];
    }
  rep(i,n-1){
    a[i+1]=max(a[i],a[i+1]);
    b[n-i-2]=max(b[n-i-2],b[n-i-1]);
    }
  rep(i,n)cout<<min(a[i],b[i])<<" ";
  cout<<endl;
  return 0;
}
0