結果
| 問題 | 
                            No.1839 Concatenation Matrix
                             | 
                    
| コンテスト | |
| ユーザー | 
                             lam6er
                         | 
                    
| 提出日時 | 2025-04-16 16:39:16 | 
| 言語 | PyPy3  (7.3.15)  | 
                    
| 結果 | 
                             
                                TLE
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 678 bytes | 
| コンパイル時間 | 480 ms | 
| コンパイル使用メモリ | 82,124 KB | 
| 実行使用メモリ | 251,816 KB | 
| 最終ジャッジ日時 | 2025-04-16 16:40:55 | 
| 合計ジャッジ時間 | 7,398 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge1 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 7 TLE * 1 -- * 8 | 
ソースコード
MOD = 998244353
def main():
    import sys
    input = sys.stdin.read().split()
    N = int(input[0])
    a = list(map(int, input[1:N+1]))
    
    # Precompute pow10 array
    max_k = N - 2
    pow10 = [10] * (max_k + 1)  # pow10[k] = 10^(2^k) mod MOD
    for k in range(1, max_k + 1):
        pow10[k] = pow(pow10[k-1], 2, MOD)
    
    current = a.copy()
    for i in range(2, N+1):
        P = pow10[i-2]
        new = []
        for j in range(N):
            next_j = (j + 1) % N
            val = (current[j] * P + current[next_j]) % MOD
            new.append(val)
        current = new
    
    for x in current:
        print(x)
if __name__ == "__main__":
    main()
            
            
            
        
            
lam6er