結果
問題 |
No.1727 [Cherry 3rd Tune] Stray
|
ユーザー |
|
提出日時 | 2021-11-06 03:58:20 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 94 ms / 6,000 ms |
コード長 | 389 bytes |
コンパイル時間 | 917 ms |
コンパイル使用メモリ | 80,316 KB |
実行使用メモリ | 45,056 KB |
最終ジャッジ日時 | 2024-11-06 21:42:58 |
合計ジャッジ時間 | 1,682 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 8 |
コンパイルメッセージ
main.cpp:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 6 | main() | ^~~~
ソースコード
#include<iostream> #include<atcoder/dsu> using namespace std; int N; int rev[1<<10]; main() { cin>>N>>N; atcoder::dsu uf(1<<N+N); for(int i=0;i<1<<N;i++) { for(int j=0;j<N;j++)rev[i]|=(i>>j&1)<<N-j-1; } for(int i=0;i<1<<N+N;i++) { int l=i&(1<<N)-1,r=i>>N; uf.merge(i,l>>1|(l&1)<<N-1|(r>>1|(r&1)<<N-1)<<N); uf.merge(i,rev[l]<<N|rev[r]); } cout<<uf.groups().size()<<endl; }