結果
| 問題 | No.1908 Assault for Keys | 
| コンテスト | |
| ユーザー |  kpinkcat | 
| 提出日時 | 2023-09-21 09:44:42 | 
| 言語 | C++17(gcc12) (gcc 12.3.0 + boost 1.87.0) | 
| 結果 | 
                                RE
                                 
                             | 
| 実行時間 | - | 
| コード長 | 684 bytes | 
| コンパイル時間 | 6,794 ms | 
| コンパイル使用メモリ | 260,496 KB | 
| 最終ジャッジ日時 | 2025-02-16 23:50:12 | 
| ジャッジサーバーID (参考情報) | judge3 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 17 RE * 1 | 
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:33:20: warning: 'max1' may be used uninitialized [-Wmaybe-uninitialized]
   33 |     cout << max1 + 1 << endl;
      |                    ^
main.cpp:16:14: note: 'max1' was declared here
   16 |     ll n, m, max1;
      |              ^~~~
            
            ソースコード
#include <bits/stdc++.h>
#include<iostream>
#include<map>
#include<vector>
#include <algorithm>
#include<math.h>
#include <iomanip>
#include<set>
#include <numeric>
#include<string>
using ll = long long;
using namespace std;
int main()
{
    ll n, m, max1;
    cin >> n >> m;
    vector<vector<ll>> s(n, vector<ll>(m));
    for (ll i = 0; i < n; i++) {
        string yn;
        cin >> yn;
        for (ll j = 0; j < m; j++) {
            if (yn[j] == 'x') s[i][j]++;
        }
    }
    for (ll i = 0; i < n; i++){
        ll sum1 = 0;
        for (ll j = 0; j < n; j++){
            sum1 += s[j][i];
        }
        max1 = max(max1, sum1);
    }
    cout << max1 + 1 << endl;
}
            
            
            
        