結果

問題 No.231 めぐるはめぐる (1)
ユーザー CleyLCleyL
提出日時 2019-06-21 00:45:47
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 404 bytes
コンパイル時間 380 ms
コンパイル使用メモリ 58,252 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-24 19:14:19
合計ジャッジ時間 1,306 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 2 ms
4,384 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 AC 1 ms
4,384 KB
testcase_10 AC 2 ms
4,376 KB
testcase_11 AC 2 ms
4,380 KB
testcase_12 AC 2 ms
4,380 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:6:7: warning: ‘ok’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   int ok;
       ^~

ソースコード

diff #

#include <iostream>
#include <cmath>
using namespace std;
int main(){
  int n;cin>>n;
  int ok;
  int okpr = 0;
  for(int i = 0; n > i; i++){
    int g,d;
    cin >> g >> d;
    if(okpr < g-(30000*d)){
      ok = i;
      okpr = g-(30000*d);
    }
  }
  if(okpr*6 < 30000*100)cout << "NO" << endl;
  else{
    cout << "YES" << endl;
    for(int i = 0; 6 > i; i++){
      cout << ok+1 << endl;
    }
  }
}
0