結果

問題 No.1727 [Cherry 3rd Tune] Stray
ユーザー 👑 KazunKazun
提出日時 2021-08-15 16:56:25
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 722 bytes
コンパイル時間 3,202 ms
コンパイル使用メモリ 141,732 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-16 13:30:31
合計ジャッジ時間 3,665 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<vector>
#include<atcoder/all>

using namespace std;

int action(int x,vector<int> a,int N){
    int y=0;
    for (int i=0; i<2*N; i++){
        if (x&(1<<i)) y|=1<<a[i];
    }
    return y;
}

int main(){
    int N; cin >> N;

    atcoder::dsu U(1<<(2*N));

    vector<int> t(2*N,0), u(2*N,0);

    // 2π/N 回転
    for (int j=0; j<N; j++){
        t[j]  =(1+j)%N;
        t[j+N]=t[j]+N;
    }

    // ひっくり返す
    for (int j=0; j<N; j++){
        u[j+N]=(N-1)-j;
        u[j]  =u[j+N]+N;
    }

    for (int S=0; S<(1<<(2*N)); S++){
        U.merge(S,action(S,t,N));
        U.merge(S,action(S,u,N));
    }

    vector<vector<int>> G=U.groups();

    cout << G.size() << endl;

}
0