結果
問題 | No.923 オセロきりきざむたん |
ユーザー |
![]() |
提出日時 | 2024-12-06 23:35:31 |
言語 | C++17(gcc12) (gcc 12.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 16 ms / 2,000 ms |
コード長 | 636 bytes |
コンパイル時間 | 4,289 ms |
コンパイル使用メモリ | 267,052 KB |
実行使用メモリ | 6,528 KB |
最終ジャッジ日時 | 2024-12-06 23:35:39 |
合計ジャッジ時間 | 6,803 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 84 |
ソースコード
#include <stdio.h>#include <atcoder/all>#include <bits/stdc++.h>using namespace std;using namespace atcoder;using mint = modint998244353;#define rep(i,n) for (int i = 0; i < (n); ++i)#define Inf32 1000000001#define Inf64 1000000000000000000LLint main(){int h,w;cin>>h>>w;vector<string> s(h);rep(i,h)cin>>s[i];bool f = true;rep(i,h){set<char> S;rep(j,w)S.insert(s[i][j]);if(S.size()==1)f = false;}if(f)cout<<"YES"<<endl;else{f =true;rep(i,w){set<char> S;rep(j,h)S.insert(s[j][i]);if(S.size()==1)f = false;}if(f)cout<<"YES"<<endl;else cout<<"NO"<<endl;}return 0;}