結果

問題 No.322 Geometry Dash
ユーザー koyumeishikoyumeishi
提出日時 2015-12-15 18:52:52
言語 C++11
(gcc 11.4.0)
結果
CE  
(最新)
AC  
(最初)
実行時間 -
コード長 730 bytes
コンパイル時間 482 ms
コンパイル使用メモリ 69,880 KB
最終ジャッジ日時 2024-04-27 02:16:35
合計ジャッジ時間 1,033 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。

コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:21:9: error: ‘iota’ was not declared in this scope
   21 |         iota(ans.begin(), ans.end(), 0);
      |         ^~~~

ソースコード

diff #

#include <iostream>
#include <vector>
#include <cstdio>
#include <sstream>
#include <map>
#include <string>
#include <algorithm>
#include <queue>
#include <cmath>
#include <set>
using namespace std;
template<class T> istream& operator >> (istream& is, vector<T>& vec){for(T& c: vec) is >> c;return is;}
template<class T> ostream& operator << (ostream& os, vector<T>& vec){for(int i=0; i<vec.size(); i++) os << vec[i] << (i==vec.size()-1?"\n":" ");return os;}

int main(){
	int n;
	cin >> n;
	vector<int> t(n),d(n);
	cin >> t >> d;
	vector<int> ans(n);
	iota(ans.begin(), ans.end(), 0);
	sort(ans.begin(), ans.end(), [&](const int& x, const int& y){return t[x]*d[y] > t[y]*d[x];});
	for(int& v: ans) v++;
	cout << ans;
	return 0;
}
0