結果

問題 No.231 めぐるはめぐる (1)
ユーザー 👑 CleyL
提出日時 2019-06-21 00:45:47
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 404 bytes
コンパイル時間 694 ms
コンパイル使用メモリ 58,140 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-23 04:09:56
合計ジャッジ時間 1,494 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 11
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:20:18: warning: ‘ok’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   20 |       cout << ok+1 << endl;
      |                  ^

ソースコード

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