結果

問題 No.231 めぐるはめぐる (1)
コンテスト
ユーザー satanic
提出日時 2015-12-06 22:35:19
言語 C++11
(gcc 15.3.0 + boost 1.92.0)
コンパイル:
g++-15 -O2 -lm -std=gnu++11 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 1 ms / 1,000 ms
+ 389µs
コード長 450 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 255 ms
コンパイル使用メモリ 73,424 KB
実行使用メモリ 10,008 KB
最終ジャッジ日時 2026-09-20 23:16:35
合計ジャッジ時間 1,402 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge4_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 11
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:22:47: warning: 'max_i' may be used uninitialized [-Wmaybe-uninitialized]
   22 |     for(int i=0; i<6; ++i) cout << max_i+1 << "\n";
      |                                               ^~~~
main.cpp:9:28: note: 'max_i' was declared here
    9 |   int n, g, d, tmp, max=0, max_i;
      |                            ^~~~~

ソースコード

diff #
raw source code

#include <iostream>
#include <algorithm>
using namespace std;
#define REST 3000000

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n, g, d, tmp, max=0, max_i;

  cin >> n;
  for(int i=0; i<n; ++i){
    cin >> g >> d;
    tmp = g-d*30000;
    if(tmp>max){
      max=tmp;
      max_i=i;
    }
  }
  if(max*6>=REST){
    cout << "YES\n";
    for(int i=0; i<6; ++i) cout << max_i+1 << "\n";
  }else{
    cout << "NO\n";
  }

  return 0;
}
0