結果

問題 No.3707 Unique Ticket
コンテスト
ユーザー river0525
提出日時 2026-09-11 21:24:27
言語 C++23(gcc16)
(gcc 16.1.0 + boost 1.92.0 + ACL)
コンパイル:
g++-16 -O2 -lm -std=c++23 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 1 ms / 2,000 ms
+ 475µs
コード長 581 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,400 ms
コンパイル使用メモリ 355,688 KB
実行使用メモリ 6,528 KB
最終ジャッジ日時 2026-09-11 21:25:30
合計ジャッジ時間 4,550 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 45
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using pint=pair<int,int>;
#define rep(i,n) for(int i=0;i<(n);++i)
template<typename T>
void chmax(T& a,T b){if(a<b){a=b;};}
template<typename T>
void chmin(T& a,T b){if(a>b){a=b;};}
const int inf=1e9;

int main(){
  int n,m;cin>>n>>m;
  vector<int> cnt(m);
  vector<string> s(n);
  rep(i,n){
    cin>>s[i];
    rep(j,m)if(s[i][j]=='o')cnt[j]++;
  }
  int ans=0;
  rep(i,n){
    bool ok=false;
    rep(j,m)if(s[i][j]=='o')ok=true;
    rep(j,m)if(s[i][j]=='o'&&cnt[j]>1)ok=false;
    ans+=ok;
  }
  cout<<ans<<endl;
}
0