結果
問題 | No.318 学学学学学 |
ユーザー |
|
提出日時 | 2016-03-21 18:23:59 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 145 ms / 2,000 ms |
コード長 | 840 bytes |
コンパイル時間 | 2,283 ms |
コンパイル使用メモリ | 169,832 KB |
実行使用メモリ | 8,576 KB |
最終ジャッジ日時 | 2024-06-22 16:25:11 |
合計ジャッジ時間 | 5,697 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 26 |
ソースコード
#define _CRT_SECURE_NO_WARNINGS#define _USE_MATH_DEFINES#include "bits/stdc++.h"#include <vector>#include <set>#include <string>#include <queue>#include <list>#define REP(i,a,b) for(i=a;i<b;++i)#define rep(i,n) REP(i,0,n)#define ll long long#define ull unsigned lltypedef long double ld;#define SQR(X) ( (X)*(X) )#define CUBE(X) ( (X)*(X)*(X) )#define ALL(a) (a).begin(),(a).end()// #define int ll#define dump(x) cout << #x << " = " << (x) << endlusing namespace std;bool test = 0;//...............signed main(){int i,j,k,l;int n;cin >> n;static int a[100005];map<int,int> m;rep(i,n) {cin >> a[i];m[a[i]] = i;}set<int> s;rep(i,n) {s.insert(a[i]);cout << *s.rbegin();if(i == m[a[i]]) s.erase(a[i]);if(i != n-1) printf(" ");}puts("");return 0;}