結果
問題 | No.923 オセロきりきざむたん |
ユーザー |
![]() |
提出日時 | 2024-12-06 23:33:37 |
言語 | C++17(gcc12) (gcc 12.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 633 bytes |
コンパイル時間 | 4,166 ms |
コンパイル使用メモリ | 267,008 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-12-06 23:33:45 |
合計ジャッジ時間 | 7,442 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 51 WA * 33 |
ソースコード
#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;}