結果
| 問題 | No.322 Geometry Dash |
| コンテスト | |
| ユーザー |
Kmcode1
|
| 提出日時 | 2015-12-15 00:16:39 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,663 bytes |
| 記録 | |
| コンパイル時間 | 1,624 ms |
| コンパイル使用メモリ | 116,828 KB |
| 実行使用メモリ | 6,624 KB |
| 最終ジャッジ日時 | 2024-09-15 12:47:56 |
| 合計ジャッジ時間 | 10,450 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 WA * 3 |
| other | AC * 1 WA * 26 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:49:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
49 | scanf("%d", &a[i]);
| ~~~~~^~~~~~~~~~~~~
main.cpp:53:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
53 | scanf("%d", &b);
| ~~~~~^~~~~~~~~~
ソースコード
#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<cctype>
#include<cstdlib>
#include<algorithm>
#include<bitset>
#include<vector>
#include<list>
#include<deque>
#include<queue>
#include<map>
#include<set>
#include<stack>
#include<cmath>
#include<sstream>
#include<fstream>
#include<iomanip>
#include<ctime>
#include<complex>
#include<functional>
#include<climits>
#include<cassert>
#include<iterator>
#include<unordered_map>
#include<unordered_set>
//#include<quadmath.h>
using namespace std;
int n;
vector<pair<int, pair<int,int> > > v;
int a[100002];
int maxt[10002];
int ind[100002];
vector<pair<int, int> > vv;
int max_ind = -1;
vector<int> ord;
set<int> s;
int main(){
cin >> n;
for (int i = 0; i < n; i++){
scanf("%d", &a[i]);
}
for (int i = 0; i < n; i++){
int b;
scanf("%d", &b);
v.push_back(make_pair(b, make_pair(a[i],i)));
}
sort(v.begin(), v.end());
memset(maxt, -1, sizeof(maxt));
for (int i = 0; i < v.size(); i++){
maxt[v[i].first] = max(maxt[v[i].first], v[i].second.first);
if (maxt[v[i].first] == v[i].second.first){
ind[i] = v[i].second.second;
}
}
v.clear();
for (int i = 0; i < 10002; i++){
if (maxt[i]>0){
vv.push_back(make_pair(maxt[i], i));
}
}
sort(vv.begin(), vv.end());
while (vv.size()){
if (vv.back().second > max_ind){
max_ind = vv.back().second;
ord.push_back(ind[vv.back().second]);
s.insert(ind[vv.back().second]);
}
vv.pop_back();
}
for (int i = 0; i < n; i++){
if (s.count(i) == 0){
ord.push_back(i);
}
}
for (int i = 0; i < ord.size(); i++){
if (i){
printf(" ");
}
printf("%d", ord[i] + 1);
}
puts("");
return 0;
}
Kmcode1