結果
| 問題 | No.930 数列圧縮 |
| コンテスト | |
| ユーザー |
mmn15277198
|
| 提出日時 | 2020-11-28 11:24:44 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 934 bytes |
| 記録 | |
| コンパイル時間 | 966 ms |
| コンパイル使用メモリ | 103,316 KB |
| 実行使用メモリ | 8,816 KB |
| 最終ジャッジ日時 | 2024-09-12 22:16:50 |
| 合計ジャッジ時間 | 5,445 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 WA * 2 |
| other | AC * 5 WA * 19 |
ソースコード
#include<iostream>
#include<stdio.h>
#include<stdlib.h>
#include<algorithm>
#include<vector>
#include<string.h>
#include<math.h>
#include<map>
#include<iomanip>
#include<queue>
using namespace std;
using ll = long long;
using ull = unsigned long long;
const ll inf = 1e9 + 7;
int main(){
cin.tie(0);
ios::sync_with_stdio(false);
//cout << fixed << setprecison(15);
int n;
cin >> n;
vector<int> a(n);
for(int i = 0; i < n; i++){
cin >> a[i];
}
map<int , int> b;
int now = a[0];
vector<int> ans;
for(int i = 1; i < n - 1; i++){
if(now < a[i]){
b[i] = 1;
ans.push_back(i);
}else{
now = a[i];
}
}
now = a[n - 1];
for(int i = n - 2; i >= 0; i--){
if(b[i] == 1)continue;
if(now > a[i]){
b[i] = 1;
ans.push_back(i);
}else{
cout << "No" << endl;
return 0;
}
}
cout << "Yes" << endl;
for(int i = 0; i < ans.size(); i++){
cout << ans[i] + 1 << " ";
}
cout << endl;
return 0;
}
mmn15277198