結果

問題 No.79 過小評価ダメ・ゼッタイ
ユーザー satanicsatanic
提出日時 2015-11-29 16:08:31
言語 C++11
(gcc 11.4.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 412 bytes
コンパイル時間 451 ms
コンパイル使用メモリ 58,656 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-08 14:39:51
合計ジャッジ時間 1,456 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 8 ms
4,376 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 WA -
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 2 ms
4,376 KB
testcase_11 AC 2 ms
4,376 KB
testcase_12 AC 2 ms
4,376 KB
testcase_13 AC 2 ms
4,380 KB
testcase_14 WA -
testcase_15 AC 3 ms
4,380 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 5 ms
4,376 KB
testcase_20 AC 8 ms
4,376 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:16:13: warning: ‘bEnd’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   while(bEnd==0){
         ~~~~^~~
main.cpp:26:21: warning: ‘result’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   cout << result << "\n";
                     ^~~~

ソースコード

diff #

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

int main(){
  ios::sync_with_stdio(false);
  int n, l;
  vector<int> level(6, 0);
  int result, bEnd;
  
  cin >> n;
  for(int i=0; i<n; ++i){
    cin >> l;
    ++level[l-1];
  }
  while(bEnd==0){
    bEnd=1;
    for(int i=0; i<6; ++i){
      if(level[i]>0){
	result=i+1;
	--level[i];
	bEnd=0;
      }
    }
  }
  cout << result << "\n";

  return 0;
}
0