結果

問題 No.1419 Power Moves
ユーザー 沙耶花沙耶花
提出日時 2021-03-05 22:45:01
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 168 ms / 2,000 ms
コード長 725 bytes
コンパイル時間 4,450 ms
コンパイル使用メモリ 256,000 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-16 10:31:40
合計ジャッジ時間 9,024 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 1 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 1 ms
5,376 KB
testcase_08 AC 1 ms
5,376 KB
testcase_09 AC 126 ms
5,376 KB
testcase_10 AC 4 ms
5,376 KB
testcase_11 AC 21 ms
5,376 KB
testcase_12 AC 138 ms
5,376 KB
testcase_13 AC 121 ms
5,376 KB
testcase_14 AC 143 ms
5,376 KB
testcase_15 AC 146 ms
5,376 KB
testcase_16 AC 144 ms
5,376 KB
testcase_17 AC 2 ms
5,376 KB
testcase_18 AC 2 ms
5,376 KB
testcase_19 AC 2 ms
5,376 KB
testcase_20 AC 160 ms
5,376 KB
testcase_21 AC 159 ms
5,376 KB
testcase_22 AC 159 ms
5,376 KB
testcase_23 AC 160 ms
5,376 KB
testcase_24 AC 161 ms
5,376 KB
testcase_25 AC 155 ms
5,376 KB
testcase_26 AC 160 ms
5,376 KB
testcase_27 AC 160 ms
5,376 KB
testcase_28 AC 160 ms
5,376 KB
testcase_29 AC 160 ms
5,376 KB
testcase_30 AC 168 ms
5,376 KB
testcase_31 AC 160 ms
5,376 KB
testcase_32 AC 166 ms
5,376 KB
testcase_33 AC 159 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <atcoder/all>
#include <bits/stdc++.h>
using namespace std;
using namespace atcoder;
using mint = modint1000000007;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define Inf 1000000001


int main(){
	
	int N,K;
	cin>>N>>K;
	
	vector<mint> cnt(N,0);
	int t = pow_mod(2,K,N);
	rep(i,t)cnt[i]++;
	{
		mint x = mint(2).pow(K);
		x -= t;
		x /= N;
		rep(i,N){
			cnt[i]+=x;
			cnt[i] /= mint(2).pow(K);
		}
	}
	
	{
		vector<mint> ncnt(N,0);
		rep(i,N){
			ncnt[(i*2)%N] += cnt[i];
		}
		swap(cnt,ncnt);
	}
	
	long long cur = (pow_mod(2,K,N)-1);
	cur %= N;
	if(cur<0)cur += N;
	vector<mint> ans(N);
	rep(i,N){
		ans[i] = cnt[(cur+i)%N];
	}
	rep(i,N){
		cout<<ans[i].val()<<endl;
	}
	
	
    return 0;
}
0