結果

問題 No.231 めぐるはめぐる (1)
ユーザー naimonon77naimonon77
提出日時 2015-10-04 15:23:31
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 781 bytes
コンパイル時間 458 ms
コンパイル使用メモリ 65,544 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-25 12:20:59
合計ジャッジ時間 1,068 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 1 ms
5,376 KB
testcase_07 AC 1 ms
5,376 KB
testcase_08 AC 2 ms
5,376 KB
testcase_09 AC 2 ms
5,376 KB
testcase_10 AC 1 ms
5,376 KB
testcase_11 AC 1 ms
5,376 KB
testcase_12 AC 2 ms
5,376 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:41:22: warning: ‘best_place’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   41 |       rep(i,6) printf("%d\n",best_place+1);
      |                ~~~~~~^~~~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <algorithm>
#include <sstream>
#include <map>
#include <set>
#include <cstdio>
using namespace std;

#define REP(i,a,b) for(i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
/* ここからが本編 */
/* */
/* 入力開始! */
/* 入力終了! */
int main(void)
{
   int i,j,k,l;
   int n;
   int d;
   int g;
   int best = 0;
   int best_place;
   cin >> n;
   rep(i,n) {
      cin >> g >> d;
      if(best < g -30000*d) {
         best = g - 30000*d;
         best_place = i;
      }
   }
   if(best*6 < 30000*100) puts("NO");
   else {
      puts("YES");
      rep(i,6) printf("%d\n",best_place+1);
   }

   return 0;
}
0