結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 9 ms
4,380 KB
testcase_01 AC 16 ms
4,500 KB
testcase_02 AC 20 ms
4,696 KB
testcase_03 AC 13 ms
4,376 KB
testcase_04 AC 16 ms
4,476 KB
testcase_05 AC 124 ms
8,740 KB
testcase_06 AC 76 ms
6,548 KB
testcase_07 AC 74 ms
5,776 KB
testcase_08 AC 64 ms
5,224 KB
testcase_09 AC 54 ms
4,664 KB
testcase_10 AC 40 ms
4,376 KB
testcase_11 AC 120 ms
8,816 KB
testcase_12 AC 84 ms
6,328 KB
testcase_13 AC 68 ms
5,500 KB
testcase_14 AC 59 ms
4,800 KB
testcase_15 AC 48 ms
4,428 KB
testcase_16 AC 36 ms
4,380 KB
testcase_17 AC 63 ms
6,388 KB
testcase_18 AC 50 ms
6,592 KB
testcase_19 AC 39 ms
6,540 KB
testcase_20 AC 30 ms
4,384 KB
testcase_21 AC 2 ms
4,376 KB
testcase_22 AC 2 ms
4,380 KB
testcase_23 AC 1 ms
4,380 KB
testcase_24 AC 1 ms
4,376 KB
testcase_25 AC 1 ms
4,380 KB
testcase_26 AC 1 ms
4,380 KB
testcase_27 AC 2 ms
4,380 KB
testcase_28 AC 1 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<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){
       scanf("%d",&a[i]);
       mp[a[i]]=i;
   }
   priority_queue<int> q;
   rep(i,n){
       q.push(a[i]);
       while(mp[q.top()]<i)q.pop();
       printf("%d ",q.top());
   }
   return 0;
}
0