結果

問題 No.2268 NGワード回避
ユーザー yicode
提出日時 2023-06-14 21:48:37
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 495 bytes
コンパイル時間 1,549 ms
コンパイル使用メモリ 168,848 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-23 03:36:00
合計ジャッジ時間 4,203 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 51 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
int main() {
  int N; cin >> N;
  vector<string> A(N);
  for(int i = 0; i < N; i++) cin >> A[i];
  string ans = "";
  for(int j = 0; j < N; j++) {
    int a = 0;
    int b = 0;
    for(int i = 0; i < N; i++) {
      if(A[i][j] == 'a') {
        a++;
      }else {
        b++;
      }
    }
    if(a >= b) {
      ans += 'b';
    }else {
      ans += 'a';
    }
  }
  cout << ans << endl;
}

0