結果
問題 | No.1013 〇マス進む |
ユーザー | たたき@競プロ |
提出日時 | 2023-10-13 04:09:55 |
言語 | C++23 (gcc 12.3.0 + boost 1.83.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 866 bytes |
コンパイル時間 | 6,172 ms |
コンパイル使用メモリ | 307,248 KB |
実行使用メモリ | 27,876 KB |
最終ジャッジ日時 | 2023-10-13 04:10:13 |
合計ジャッジ時間 | 12,579 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge13 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
4,368 KB |
testcase_01 | AC | 1 ms
4,368 KB |
testcase_02 | AC | 1 ms
4,372 KB |
testcase_03 | AC | 2 ms
4,372 KB |
testcase_04 | AC | 1 ms
4,368 KB |
testcase_05 | AC | 2 ms
4,368 KB |
testcase_06 | AC | 2 ms
4,368 KB |
testcase_07 | AC | 2 ms
4,372 KB |
testcase_08 | AC | 2 ms
4,372 KB |
testcase_09 | AC | 2 ms
4,368 KB |
testcase_10 | AC | 2 ms
4,368 KB |
testcase_11 | AC | 2 ms
4,372 KB |
testcase_12 | AC | 2 ms
4,372 KB |
testcase_13 | AC | 4 ms
4,368 KB |
testcase_14 | AC | 32 ms
14,644 KB |
testcase_15 | AC | 51 ms
22,220 KB |
testcase_16 | AC | 46 ms
20,676 KB |
testcase_17 | AC | 28 ms
13,540 KB |
testcase_18 | AC | 35 ms
15,628 KB |
testcase_19 | AC | 21 ms
10,528 KB |
testcase_20 | AC | 63 ms
26,704 KB |
testcase_21 | AC | 26 ms
12,512 KB |
testcase_22 | AC | 36 ms
16,260 KB |
testcase_23 | AC | 12 ms
7,360 KB |
testcase_24 | AC | 64 ms
27,492 KB |
testcase_25 | AC | 63 ms
26,704 KB |
testcase_26 | AC | 13 ms
7,252 KB |
testcase_27 | AC | 24 ms
11,972 KB |
testcase_28 | AC | 12 ms
7,264 KB |
testcase_29 | AC | 60 ms
25,940 KB |
testcase_30 | AC | 22 ms
11,088 KB |
testcase_31 | AC | 40 ms
18,500 KB |
testcase_32 | AC | 31 ms
14,364 KB |
testcase_33 | WA | - |
testcase_34 | WA | - |
testcase_35 | WA | - |
testcase_36 | WA | - |
testcase_37 | WA | - |
testcase_38 | WA | - |
testcase_39 | WA | - |
testcase_40 | WA | - |
testcase_41 | WA | - |
testcase_42 | WA | - |
testcase_43 | WA | - |
testcase_44 | WA | - |
testcase_45 | WA | - |
testcase_46 | WA | - |
testcase_47 | WA | - |
testcase_48 | WA | - |
testcase_49 | WA | - |
testcase_50 | WA | - |
testcase_51 | WA | - |
testcase_52 | WA | - |
testcase_53 | WA | - |
testcase_54 | WA | - |
testcase_55 | WA | - |
testcase_56 | WA | - |
testcase_57 | WA | - |
testcase_58 | WA | - |
testcase_59 | WA | - |
testcase_60 | WA | - |
testcase_61 | AC | 64 ms
27,700 KB |
testcase_62 | AC | 63 ms
27,592 KB |
testcase_63 | AC | 1 ms
4,368 KB |
testcase_64 | AC | 1 ms
4,368 KB |
ソースコード
#include<bits/stdc++.h> using namespace std; #include <atcoder/all> using namespace atcoder; using mint=modint998244353; //1000000007; using ll=long long; using pp=pair<int,int>; #define sr string #define vc vector #define fi first #define se second #define rep(i,n) for(int i=0;i<(int)n;i++) #define pb push_back #define all(v) v.begin(),v.end() #define pque priority_queue #define bpc(a) __builtin_popcount(a) int main(){ int n,k;cin>>n>>k; vc<int>v(n); rep(i,n)cin>>v[i]; vc<int>vr(n); rep(i,n)vr[i]=(i+v[i])%n; int t=30; vc vx(t,vc<int>(n,0)); vc vy(t,vc<int>(n,0)); vy[0]=v; vx[0]=vr; rep(i,t-1)rep(j,n)vx[i+1][j]=vx[i][vx[i][j]]; rep(i,t-1)rep(j,n)vy[i+1][j]=vy[i][j]+vy[i][vx[i][j]]; rep(i,n){ int a=i; int ans=i; for(int j=t-1;j>=0;j--)if(k>>j&1){ ans+=vy[j][a]; a=vx[j][a]; } cout<<ans+1<<"\n"; } }