結果
| 問題 |
No.231 めぐるはめぐる (1)
|
| コンテスト | |
| ユーザー |
カルロス
|
| 提出日時 | 2015-09-17 15:40:08 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 1,000 ms |
| コード長 | 432 bytes |
| コンパイル時間 | 151 ms |
| コンパイル使用メモリ | 20,352 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-07 23:46:58 |
| 合計ジャッジ時間 | 804 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 11 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:5:5: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
5 | scanf("%d", &N);
| ^~~~~~~~~~~~~~~
main.c:8:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
8 | scanf("%d %d", &G, &D);
| ^~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
int main(void){
int i, N, G, D;
scanf("%d", &N);
int maxD = -1, maxexp = 0;
for(i=0;i<N;i++){
scanf("%d %d", &G, &D);
if(G-30000*D>maxexp){
maxD = i+1;
maxexp = G-30000*D;
}
}
if(maxexp*6>=3000000){
printf("YES\n%d\n%d\n%d\n%d\n%d\n%d\n", maxD, maxD, maxD, maxD, maxD, maxD);
}else{
printf("NO\n");
}
return 0;
}
カルロス