ソースコード 拡げる

Copy
```#include <bits/stdc++.h>
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define chmin(x,y) x = min((x),(y));
#define chmax(x,y) x = max((x),(y));
using namespace std;
using ll = long long ;
using P = pair<int,int> ;
using pll = pair<long long,long long>;
const int INF = 1e9;
const long long LINF = 1e17;
const int MOD = 1000000007;
//const int MOD = 998244353;
const double PI = 3.14159265358979323846;

ll dp[(1<<20)+5];
ll ng[50];

int main(){
ll n,m;
cin >> n >> m;
vector<ll> a(m),b(m);
rep(i,m) cin >> a[i] >> b[i];
rep(i,m) --a[i],--b[i];
if(n==1){
cout << 1 << endl;
return 0;
}
rep(i,n){
rep(j,m){
if(a[j] == i) mask += 1LL<<b[j];
else if(b[j] == i) mask += 1LL<<a[j];
}
}
rep(bit,1<<(n/2)){
bool ok = true;
rep(i,n/2){
if(bit>>i&1LL){
if((ng[i] & bit) > 0) ok = false;
}
}
if(ok) dp[bit] = __builtin_popcountll(bit);
else{
rep(i,n/2){
if(bit>>i&1LL) chmax(dp[bit],dp[bit^(1LL<<i)]);
}
}
}

ll ans = 0;
rep(bit,1<<((n+1)/2)){
bool ok = true;
rep(i,(n+1)/2){
if(bit>>i&1LL){
if((ng[n/2+i] & (bit<<(n/2))) > 0) ok = false;
}
}
if(ok){
rep(i,(n+1)/2){
}
}
}
cout << ans << endl;
return 0;
}```

提出情報

提出日時 2020-11-19 17:24:26+0900 G - Mixture Drug kapibara C++ (GCC 9.2.1) 600 1765 Byte AC 213 ms 11808 KB

ジャッジ結果

セット名 Sample All

 AC × 3
 AC × 51
セット名 テストケース
Sample sample_01.txt, sample_02.txt, sample_03.txt
ケース名 結果 実行時間 メモリ
sample_01.txt AC 8 ms 3572 KB
sample_02.txt AC 2 ms 3384 KB
sample_03.txt AC 2 ms 3416 KB
subtask_1_1.txt AC 2 ms 3460 KB
subtask_1_10.txt AC 190 ms 11740 KB
subtask_1_11.txt AC 3 ms 3468 KB
subtask_1_12.txt AC 185 ms 11640 KB
subtask_1_13.txt AC 166 ms 7568 KB
subtask_1_14.txt AC 213 ms 11580 KB
subtask_1_15.txt AC 2 ms 3476 KB
subtask_1_16.txt AC 177 ms 11588 KB
subtask_1_17.txt AC 186 ms 11796 KB
subtask_1_18.txt AC 182 ms 11608 KB
subtask_1_19.txt AC 5 ms 3424 KB
subtask_1_2.txt AC 185 ms 11648 KB
subtask_1_20.txt AC 172 ms 11768 KB
subtask_1_21.txt AC 186 ms 11772 KB
subtask_1_22.txt AC 180 ms 11768 KB
subtask_1_23.txt AC 3 ms 3576 KB
subtask_1_24.txt AC 17 ms 4044 KB
subtask_1_25.txt AC 186 ms 11764 KB
subtask_1_26.txt AC 185 ms 11688 KB
subtask_1_27.txt AC 181 ms 11668 KB
subtask_1_28.txt AC 184 ms 11668 KB
subtask_1_29.txt AC 184 ms 11728 KB
subtask_1_3.txt AC 35 ms 4504 KB
subtask_1_30.txt AC 2 ms 3572 KB
subtask_1_31.txt AC 3 ms 3504 KB
subtask_1_32.txt AC 5 ms 3428 KB
subtask_1_33.txt AC 21 ms 3724 KB
subtask_1_34.txt AC 169 ms 11580 KB
subtask_1_35.txt AC 180 ms 11664 KB
subtask_1_36.txt AC 181 ms 11644 KB
subtask_1_37.txt AC 186 ms 11612 KB
subtask_1_38.txt AC 184 ms 11808 KB
subtask_1_39.txt AC 183 ms 11776 KB
subtask_1_4.txt AC 180 ms 11796 KB
subtask_1_40.txt AC 185 ms 11672 KB
subtask_1_41.txt AC 185 ms 11736 KB
subtask_1_42.txt AC 182 ms 11796 KB
subtask_1_43.txt AC 193 ms 11692 KB
subtask_1_44.txt AC 180 ms 11720 KB
subtask_1_45.txt AC 183 ms 11764 KB
subtask_1_46.txt AC 207 ms 11584 KB
subtask_1_47.txt AC 181 ms 11608 KB
subtask_1_48.txt AC 159 ms 11720 KB
subtask_1_5.txt AC 51 ms 5656 KB
subtask_1_6.txt AC 182 ms 11668 KB
subtask_1_7.txt AC 67 ms 5592 KB
subtask_1_8.txt AC 179 ms 11692 KB
subtask_1_9.txt AC 92 ms 7556 KB