結果

問題 No.231 めぐるはめぐる (1)
ユーザー くれちーくれちー
提出日時 2016-09-29 22:24:30
言語 C90
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 416 bytes
コンパイル時間 157 ms
コンパイル使用メモリ 21,120 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-05-01 07:51:35
合計ジャッジ時間 1,535 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 1 ms
5,376 KB
testcase_04 AC 0 ms
5,376 KB
testcase_05 WA -
testcase_06 AC 1 ms
5,376 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 0 ms
5,376 KB
testcase_10 AC 0 ms
5,376 KB
testcase_11 AC 0 ms
5,376 KB
testcase_12 AC 1 ms
5,376 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:7:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    7 |         scanf("%d", &n);
      |         ^~~~~~~~~~~~~~~
main.c:9:17: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    9 |                 scanf("%d %d", &g[i], &d[i]);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>

int main() {
	int n, g[1000], d[1000], max, maxi, i;
	const int exp = 30000 * 100;

	scanf("%d", &n);
	for (i = 0; i < n; i++) {
		scanf("%d %d", &g[i], &d[i]);
		if (i == 0 || g[i] - 3000 * d[i] > max) {
			max = g[i] - 3000 * d[i];
			maxi = i;
		}
	}

	if (max * 6 >= exp) {
		printf("YES\n");
		for (i = 0; i < 6; i++) {
			printf("%d\n", maxi + 1);
		}
	}
	else printf("NO\n");

	return 0;
}
0