結果

問題 No.231 めぐるはめぐる (1)
コンテスト
ユーザー itezpace
提出日時 2016-06-12 07:01:39
言語 C++11
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=gnu++11 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 412 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 494 ms
コンパイル使用メモリ 70,656 KB
実行使用メモリ 6,400 KB
最終ジャッジ日時 2026-05-08 07:37:57
合計ジャッジ時間 1,828 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 11
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:28:13: warning: 'p' may be used uninitialized [-Wmaybe-uninitialized]
   28 |       cout<<p<<endl;
      |             ^
main.cpp:4:15: note: 'p' was declared here
    4 |   int n,g,d,e,p;
      |               ^

ソースコード

diff #
raw source code

#include <iostream>
using namespace std;
int main(){
  int n,g,d,e,p;
  int m=0;
  int t=30000*100;
  cin>>n;
  for(int i=0; i<n; ++i){
    cin>>g>>d;
    if(d>0){
      e=g-d*30000;
    } else {
      e=g;
    }
    if(e>m){
      m=e;
      p=i+1;
    }
  }

  t-=m*6;

  if(t>0){
    cout<<"NO"<<endl;
  } else {
    cout<<"YES"<<endl;
    for(int i=0; i<6; ++i){
      cout<<p<<endl;
    }
  }
  return 0;
}
0