結果

問題 No.231 めぐるはめぐる (1)
コンテスト
ユーザー qzpm
提出日時 2015-06-26 22:31:51
言語 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
結果
WA  
実行時間 -
コード長 576 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 3,851 ms
コンパイル使用メモリ 71,888 KB
実行使用メモリ 7,848 KB
最終ジャッジ日時 2026-03-29 08:52:34
合計ジャッジ時間 5,450 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other WA * 11
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:17:34: warning: 'b' may be used uninitialized [-Wmaybe-uninitialized]
   17 |     if(((table[b][0] - table[b][1] * 30000) * 6) >= 300000){
      |                        ~~~~~~~~~~^
main.cpp:8:9: note: 'b' was declared here
    8 |     int b;
      |         ^

ソースコード

diff #
raw source code

#include <iostream>
using namespace std;
int main(void){
    int N;
    cin >> N;
    int table[1001][2];
    int a = 0;
    int b;
    for(int i = 0;i < N;i++){
        cin >> table[i][0];
        cin >> table[i][1];
        if(a <= table[i][0] - table[i][1] * 30000){
            a = table[i][0] - table[i][1] * 30000;
            b = i;
        }
    }
    if(((table[b][0] - table[b][1] * 30000) * 6) >= 300000){
        cout << "YES" << endl;
        for(int i = 0;i < 6;i++){
            cout << b << endl;
        }
    }else{
        cout << "NO" << endl;
    }
    
}
0