結果

問題 No.318 学学学学学
ユーザー tempura_pptempura_pp
提出日時 2018-07-18 15:46:12
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 137 ms / 2,000 ms
コード長 760 bytes
コンパイル時間 1,565 ms
コンパイル使用メモリ 94,132 KB
実行使用メモリ 8,584 KB
最終ジャッジ日時 2023-09-04 21:07:13
合計ジャッジ時間 5,263 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 10 ms
4,376 KB
testcase_01 AC 20 ms
4,380 KB
testcase_02 AC 24 ms
4,464 KB
testcase_03 AC 16 ms
4,376 KB
testcase_04 AC 21 ms
4,412 KB
testcase_05 AC 137 ms
8,556 KB
testcase_06 AC 98 ms
6,432 KB
testcase_07 AC 95 ms
5,584 KB
testcase_08 AC 88 ms
4,944 KB
testcase_09 AC 77 ms
4,572 KB
testcase_10 AC 64 ms
4,380 KB
testcase_11 AC 135 ms
8,584 KB
testcase_12 AC 104 ms
6,244 KB
testcase_13 AC 91 ms
5,332 KB
testcase_14 AC 82 ms
4,692 KB
testcase_15 AC 73 ms
4,380 KB
testcase_16 AC 60 ms
4,376 KB
testcase_17 AC 80 ms
6,228 KB
testcase_18 AC 68 ms
6,288 KB
testcase_19 AC 55 ms
6,484 KB
testcase_20 AC 40 ms
4,376 KB
testcase_21 AC 2 ms
4,380 KB
testcase_22 AC 2 ms
4,376 KB
testcase_23 AC 2 ms
4,380 KB
testcase_24 AC 2 ms
4,376 KB
testcase_25 AC 1 ms
4,380 KB
testcase_26 AC 2 ms
4,376 KB
testcase_27 AC 1 ms
4,380 KB
testcase_28 AC 1 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<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 ;
int dx[4]={1,0,-1,0} , dy[4]={0,1,0,-1} ;

int main(){
   int n;
   cin>>n;
   int a[n];
   map<int,int>mp;
   rep(i,n){
       cin>>a[i];
       mp[a[i]]=i;
   }
   priority_queue<int> q;
   rep(i,n){
       q.push(a[i]);
       while(mp[q.top()]<i)q.pop();
       cout<<q.top()<<" ";
   }
   return 0;
}
0