結果

問題 No.231 めぐるはめぐる (1)
ユーザー miku39kk
提出日時 2017-07-26 11:42:07
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 472 bytes
コンパイル時間 447 ms
コンパイル使用メモリ 59,516 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-09 17:42:41
合計ジャッジ時間 1,113 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 11
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:22:21: warning: ‘num’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   22 |             cout << num << endl;
      |                     ^~~

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main() {
    int n,exp = 0,num;
    cin >> n;
    for(int i = 0;i < n;i++){
        int d,g;
        cin >> g >> d;
        if(exp < g - 30000*d){
            exp = g - 30000*d;
            num = i+1;
        }
    }
    if(3000000 > exp*6)cout << "NO\n";
    else{
        cout << "YES\n";
        for(int i = 0;i < 6;i++){
            cout << num << endl;
        }
    }
return 0;
}
0