結果

問題 No.2270 T0空間
ユーザー HIcoderHIcoder
提出日時 2023-07-23 22:00:25
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,413 bytes
コンパイル時間 1,094 ms
コンパイル使用メモリ 112,948 KB
実行使用メモリ 37,696 KB
最終ジャッジ日時 2023-10-25 06:02:20
合計ジャッジ時間 6,039 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 1 ms
4,348 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 2 ms
4,348 KB
testcase_06 AC 2 ms
4,348 KB
testcase_07 AC 1 ms
4,348 KB
testcase_08 AC 2 ms
4,348 KB
testcase_09 AC 2 ms
4,348 KB
testcase_10 AC 2 ms
4,348 KB
testcase_11 AC 84 ms
9,144 KB
testcase_12 AC 48 ms
5,712 KB
testcase_13 AC 152 ms
15,216 KB
testcase_14 AC 310 ms
15,216 KB
testcase_15 AC 125 ms
15,216 KB
testcase_16 AC 210 ms
22,344 KB
testcase_17 WA -
testcase_18 AC 389 ms
37,656 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 383 ms
37,656 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

/*
WA
*/
#include<iostream>
#include<set>
#include<algorithm>
#include<vector>
#include<string>
#include<set>
#include<map>
#include<numeric>
#include<queue>
#include<cmath>
#include<random>
//#include<fstream>

using namespace std;
typedef long long ll;
const ll INF=1LL<<60;
typedef pair<ll,ll> P;
typedef pair<int,P> PP;
const ll MOD=998244353;

int main(){
    int N,M;
    cin>>N;
    cin>>M;
    vector<string> s(M);

    vector<ll> S(M);
    for(int i=0;i<M;i++){
        cin>>s[i];

        ll num=0;
        for(char c:s[i]){
            num*=2;
            num+=(int)(c-'0');
        }
        S[i]=num;
    }

    for(int n0=0;n0<N;n0++){
        for(int n1=n0+1;n1<N;n1++){
            if(n0==n1) continue;
            
            bool flag=false;
            
            for(ll v:S){
                //Sのなかでn0,n1番目で異なるものが存在
                if( ((v>>n0)&1) != ((v>>n1)&1) ){
                
                    flag=true;
                }
            }
            
           /*
            for(string& v:s){
                //Sのなかでn0,n1番目で異なるものが存在
                if( v[n0] != v[n1]){
                
                    flag=true;
                }
            }
            */

            if(!flag){
                cout<<"No"<<endl;
                return 0;
            }
        }
    }

     cout<<"Yes"<<endl;
    return 0;

}
0