結果
問題 | No.1081 和の和 |
ユーザー |
|
提出日時 | 2021-05-22 12:48:50 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 39 ms / 2,000 ms |
コード長 | 1,082 bytes |
コンパイル時間 | 190 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 12,288 KB |
最終ジャッジ日時 | 2024-10-10 10:56:28 |
合計ジャッジ時間 | 1,031 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 8 |
ソースコード
import sysfrom collections import deque, defaultdict,Counterfrom copy import deepcopyfrom bisect import bisect_left, bisect_right, insort_left, insort_rightfrom heapq import heapify, heappop, heappushfrom itertools import product, permutations, combinations, combinations_with_replacementfrom functools import reducefrom math import gcd, sin, cos, tan, asin, acos, atan, degrees, radians, ceil, floor, log, sqrt, ceil, floor, pi, hypotfrom string import ascii_lowercasefrom decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVENsys.setrecursionlimit(1000000)INF = 10**18MOD = 10**9+7# MOD = 998244353yes="Yes"no="No"from random import randintdef II():return int(input())def SI():return str(input())def MI():return map(int,input().split())def MS():return map(str,input().split())def LI():return list(map(int,input().split()))n=II()a=LI()ans=[[] for i in range(n-1)]def check(lis):ans=[]for i in range(len(lis)-1):ans.append(lis[i]+lis[i+1])if len(ans)==1:return anselse:return check(ans)print(check(a)[0]%MOD)