結果

問題 No.231 めぐるはめぐる (1)
ユーザー itezpace
提出日時 2016-06-12 07:01:39
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 3 ms / 1,000 ms
コード長 412 bytes
コンパイル時間 700 ms
コンパイル使用メモリ 54,520 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-08 00:21:02
合計ジャッジ時間 1,427 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 11
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:28:13: warning: ‘p’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   28 |       cout<<p<<endl;
      |             ^

ソースコード

diff #

#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