結果

問題 No.322 Geometry Dash
ユーザー piyoko_212piyoko_212
提出日時 2015-12-21 14:13:19
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 41 ms / 2,000 ms
コード長 503 bytes
コンパイル時間 264 ms
コンパイル使用メモリ 37,580 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-26 05:48:43
合計ジャッジ時間 4,545 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 0 ms
5,376 KB
testcase_02 AC 0 ms
5,376 KB
testcase_03 AC 0 ms
5,376 KB
testcase_04 AC 31 ms
5,376 KB
testcase_05 AC 32 ms
5,376 KB
testcase_06 AC 35 ms
5,376 KB
testcase_07 AC 36 ms
5,376 KB
testcase_08 AC 37 ms
5,376 KB
testcase_09 AC 32 ms
5,376 KB
testcase_10 AC 33 ms
5,376 KB
testcase_11 AC 35 ms
5,376 KB
testcase_12 AC 36 ms
5,376 KB
testcase_13 AC 38 ms
5,376 KB
testcase_14 AC 35 ms
5,376 KB
testcase_15 AC 35 ms
5,376 KB
testcase_16 AC 38 ms
5,376 KB
testcase_17 AC 38 ms
5,376 KB
testcase_18 AC 40 ms
5,376 KB
testcase_19 AC 36 ms
5,376 KB
testcase_20 AC 36 ms
5,376 KB
testcase_21 AC 38 ms
5,376 KB
testcase_22 AC 39 ms
5,376 KB
testcase_23 AC 41 ms
5,376 KB
testcase_24 AC 37 ms
5,376 KB
testcase_25 AC 37 ms
5,376 KB
testcase_26 AC 39 ms
5,376 KB
testcase_27 AC 39 ms
5,376 KB
testcase_28 AC 41 ms
5,376 KB
testcase_29 AC 34 ms
5,376 KB
testcase_30 AC 34 ms
5,376 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:16:20: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   16 |         int a;scanf("%d",&a);
      |               ~~~~~^~~~~~~~~
main.cpp:17:34: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   17 |         for(int i=0;i<a;i++)scanf("%d",p+i);
      |                             ~~~~~^~~~~~~~~~
main.cpp:18:34: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   18 |         for(int i=0;i<a;i++)scanf("%d",q+i);
      |                             ~~~~~^~~~~~~~~~

ソースコード

diff #

#include<stdio.h>
#include<algorithm>
using namespace std;
int p[210000];
int q[210000];
struct st{
	int t,d;
	int id;
	st(){}
};
inline bool operator<(const st &a,const st &b){
	return a.t*b.d>a.d*b.t;
}
st r[210000];
int main(){
	int a;scanf("%d",&a);
	for(int i=0;i<a;i++)scanf("%d",p+i);
	for(int i=0;i<a;i++)scanf("%d",q+i);
	for(int i=0;i<a;i++){
		r[i].t=p[i];
		r[i].d=q[i];
		r[i].id=i+1;
	}
	std::sort(r,r+a);
	for(int i=0;i<a;i++){
		if(i)printf(" ");printf("%d",r[i].id);
	}
	printf("\n");
}
0