結果

問題 No.43 野球の試合
ユーザー nenuonnenuon
提出日時 2017-06-25 12:30:49
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,144 bytes
コンパイル時間 994 ms
コンパイル使用メモリ 86,728 KB
実行使用メモリ 4,508 KB
最終ジャッジ日時 2023-07-27 13:19:09
合計ジャッジ時間 1,962 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 2 ms
4,380 KB
testcase_10 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <cmath>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <stdlib.h>
#include <stdio.h>
#include <bitset>
using namespace std;
#define FOR(I,A,B) for(int I = (A); I < (B); ++I)
typedef long long ll;
// kくんは全て勝つ
// それ以外は勝ち数が少ないチームが勝つ
int main(){
  int N;
  cin >> N;
  vector<string> vs;
  FOR(i,0,N){
    string s;
    cin >> s;
    vs.push_back(s);
  }
  int win[N];
  FOR(i,0,N){
    win[i] = 0;
  }
  FOR(i,0,N){
    FOR(j,0,N){
      if(vs[i][j]=='o'){
        win[i]++;
      }
      else if(i == 0 && vs[i][j] == '-'){
        vs[i][j] = 'o';
        vs[j][i] = 'x';
        win[i]++;
      }
      else if(vs[i][j] == '-'){
        if(win[i] < win[j]){
          vs[i][j] = 'o';
          vs[j][i] = 'x';
          win[i]++;
        } else {
          vs[i][j] = 'x';
          vs[j][i] = 'o';
          win[j]++;
        }
      }
    }
  }
  int ans = 1;
  FOR(i,1,N){
    if(win[0]<win[i]) ans++;
  }
  cout << ans << endl;
  return 0;
}
0