結果
問題 | No.318 学学学学学 |
ユーザー | ciel |
提出日時 | 2015-12-11 07:02:19 |
言語 | C++11 (gcc 11.4.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 421 bytes |
コンパイル時間 | 633 ms |
コンパイル使用メモリ | 68,116 KB |
実行使用メモリ | 7,556 KB |
最終ジャッジ日時 | 2023-10-13 10:52:52 |
合計ジャッジ時間 | 8,802 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge12 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 5 ms
4,348 KB |
testcase_01 | AC | 9 ms
4,352 KB |
testcase_02 | WA | - |
testcase_03 | AC | 7 ms
4,352 KB |
testcase_04 | WA | - |
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 | WA | - |
testcase_15 | WA | - |
testcase_16 | WA | - |
testcase_17 | WA | - |
testcase_18 | WA | - |
testcase_19 | WA | - |
testcase_20 | WA | - |
testcase_21 | AC | 1 ms
4,348 KB |
testcase_22 | AC | 2 ms
4,348 KB |
testcase_23 | AC | 1 ms
4,348 KB |
testcase_24 | AC | 1 ms
4,352 KB |
testcase_25 | AC | 1 ms
4,352 KB |
testcase_26 | AC | 2 ms
4,348 KB |
testcase_27 | WA | - |
testcase_28 | WA | - |
ソースコード
#include <vector> #include <unordered_map> #include <cstdio> using namespace std; int main(){ int N; unordered_map<int,pair<int,int> >m; scanf("%d",&N); for(int i=0,x;i<N;i++){ scanf("%d",&x); if(m.find(x)==m.end())m[x]=make_pair(i,i); else m[x].second=i; } vector<int> v(N); for(auto &e:m)for(int i=e.second.first;i<=e.second.second;i++)v[i]=e.first; for(int i=0;i<N;i++)printf(i<N-1?"%d ":"%d\n",v[i]); }