s_id
stringlengths
10
10
p_id
stringlengths
6
6
u_id
stringlengths
10
10
date
stringlengths
10
10
language
stringclasses
1 value
original_language
stringclasses
11 values
filename_ext
stringclasses
1 value
status
stringclasses
1 value
cpu_time
stringlengths
1
5
memory
stringlengths
1
7
code_size
stringlengths
1
6
code
stringlengths
1
539k
s650789126
p02554
u417365712
1600080047
Python
Python (3.8.2)
py
Runtime Error
27
9020
75
n = int(input()) print(pow(10, n, mod) - 2*pow(9, n, mod) - pow(9, n, mod))
s771627587
p02554
u329319441
1600068828
Python
Python (3.8.2)
py
Runtime Error
24
9144
224
N = int(input()) MOD = 10 ** 9 + 7 if N == 1: print(0) exit() a = 1 b = 1 c = 1 for i in range(N): a = pow(10, n, MOD) b = pow(9, n, MOD) c = pow(8, n, MOD) ans = a - (2 * b) + c if ans < 0: ans += MOD print(ans)
s248999346
p02554
u243312682
1600061251
Python
Python (3.8.2)
py
Runtime Error
24
9076
694
def main(): n = int(input()) mod = 10 ** 9 + 7 #素数 def modpow(x, n, mod): res = 1 while n: if n % 2: res *= x % mod res %= res x *= x % mod n >>= 1 return res # 全パターン:10 ** n all_p = modpow(10, n, mod)...
s213791717
p02554
u595893956
1600057445
Python
Python (3.8.2)
py
Runtime Error
128
9068
250
def bekijou(a,x): MOD = 1000000009 ret = 1 for _ in range(x): ret *= a ret %= MOD n=int(input()) ret = 0 sum = bekijou(9,n) MOD = 1000000009 ret = (2 * sum) % MOD ret += MOD - bekijou(8,n) ret = bekijou(10,n) + MOD - ret print(ret)
s585265915
p02554
u624830211
1600044270
Python
Python (3.8.2)
py
Runtime Error
24
9048
194
import math import sys a=1000000007 def modd(x, y): z=1 for i in range(y): z=z*x%a return z j=int(sys.argv[1]) ans=modd(10, j)-modd(9, j)-modd(9, j)+modd(8, j) print(ans%a)
s710795256
p02554
u624830211
1600044250
Python
Python (3.8.2)
py
Runtime Error
23
9016
184
import math a=1000000007 def modd(x, y): z=1 for i in range(y): z=z*x%a return z j=int(sys.argv[1]) ans=modd(10, j)-modd(9, j)-modd(9, j)+modd(8, j) print(ans%a)
s219727768
p02554
u719790500
1600043021
Python
Python (3.8.2)
py
Runtime Error
20
8936
489
#include <iostream> #include <vector> #include <algorithm> #include <string> #include <ctype.h> #include <cstdlib> #include <cmath> #include <stack> #define _GLIBCXX_DEBUG using namespace std; int main() { int n; cin >> n; long long a = 1, b = 1, c = 1; for (int i = 0; i < n; i++) { a *= 10...
s733703575
p02554
u370986618
1600041637
Python
Python (3.8.2)
py
Runtime Error
26
8980
4363
#include <bits/stdc++.h> using namespace std; #define pb(a) push_back((a)) #define mp(a, b) make_pair((a), (b)) #define REP(a, b) for (ll i = (a); i < (b); i++) #define REP2(a, b) for (ll j = (a); j < (b); j++) #define REPE(a, b, c, d) \ REP(a, b) \ for (ll j = (c); j < (d); j++) #define REPV(a, b, ...
s315556157
p02554
u370986618
1600041520
Python
Python (3.8.2)
py
Runtime Error
26
8648
4361
#include <bits/stdc++.h> using namespace std; #define pb(a) push_back((a)) #define mp(a, b) make_pair((a), (b)) #define REP(a, b) for (ll i = (a); i < (b); i++) #define REP2(a, b) for (ll j = (a); j < (b); j++) #define REPE(a, b, c, d) \ REP(a, b) \ for (ll j = (c); j < (d); j++) #define REPV(a, b, ...
s043220515
p02554
u370986618
1600041273
Python
Python (3.8.2)
py
Runtime Error
26
8820
4360
#include <bits/stdc++.h> using namespace std; #define pb(a) push_back((a)) #define mp(a, b) make_pair((a), (b)) #define REP(a, b) for (ll i = (a); i < (b); i++) #define REP2(a, b) for (ll j = (a); j < (b); j++) #define REPE(a, b, c, d) \ REP(a, b) \ for (ll j = (c); j < (d); j++) #define REPV(a, b, ...
s705226919
p02554
u505564549
1600040701
Python
Python (3.8.2)
py
Runtime Error
30
9204
293
import sys input = sys.stdin.readline mod = int(1e9)+7 def solve(): n=int(input()) if n<3: print(0) return dp=[0]*2001 dp[3]=dp[4]=dp[5]=1 for i in range(6,n+1): dp[i]=(dp[i-1]+dp[i-3])%mod print(dp[n]) if __name__=="__main__": solve()
s656171727
p02554
u167993508
1600040425
Python
Python (3.8.2)
py
Runtime Error
28
9012
258
def binexp(b): res = 1 while b>0: if b&1: res *= a res%=mod a *= a a%=mod b>>=1 return res mod = 1000000007 n = int(input()) if n==1: print(0) elif n==2: print(1) else: count = 1 n -= 2 ans = binexp(n) print(ans)
s593975991
p02554
u467507627
1600036545
Python
Python (3.8.2)
py
Runtime Error
24
8928
398
#include <bits/stdc++.h> #include <stdio.h> #include <string.h> #define rep(i,n) for (int i=0; i<n; i++) using namespace std; using ll = long long; using P = pair<int, int>; ll n; ll MOD = 1000000007; int main(){ cin>>n; if(n<2) cout<<"0"<<endl; else{ ll ans = n * (n-1) % MOD; for(int i=0; i<n-2; i++){...
s215943745
p02554
u163354164
1600035259
Python
Python (3.8.2)
py
Runtime Error
581
11184
61
n =int(input()) Sum=(10**n)-(9**n)-(9**n)+(8**n) Print( Sum)
s969150408
p02554
u163354164
1600035140
Python
Python (3.8.2)
py
Runtime Error
26
9144
52
n =int(input()) Print((10**n)-(9**n)-(9**n)+(8**n))
s358030942
p02554
u163354164
1600035076
Python
Python (3.8.2)
py
Runtime Error
26
9012
43
N =int(input()) Print(10**n-9**n-9**n+8**n)
s592406671
p02554
u944396627
1600034013
Python
PyPy3 (7.3.0)
py
Runtime Error
89
74820
454
import sys sys.setrecursionlimit(250000) from scipy.special import comb # a = comb(n, r) def main(): # a,b,c,d = map(int, input().split()) n = int(input()) # temp = (10 ** 9 + 7) # sum = 0 # if n >= 2: # for i in range(2, n+1): # a = int(comb(i, 2)) * 2 # a = (a * ...
s908360733
p02554
u944396627
1600033858
Python
PyPy3 (7.3.0)
py
Runtime Error
105
74752
468
import sys sys.setrecursionlimit(250000) from scipy.special import comb # a = comb(n, r) def main(): # a,b,c,d = map(int, input().split()) n = int(input()) sum = 10**n - 9**n*2 + 8**n # temp = (10 ** 9 + 7) # sum = 0 # if n >= 2: # for i in range(2, n+1): # a = int(comb(i,...
s474462233
p02554
u380491044
1600033637
Python
Python (3.8.2)
py
Runtime Error
24
9004
255
#include<bits/stdc++.h> using namespace std; const int64_t mod=1000000007; int main(){ int64_t n,a=1,b=1,c=1; cin >> n; for(int i=0;i<n;i++){ a*=10;a%=mod; b*=9;b%=mod; c*=8;c%=mod; } cout << (mod+a-b-b+c)%mod << endl; return 0; }
s466346768
p02554
u944396627
1600033626
Python
PyPy3 (7.3.0)
py
Runtime Error
109
68684
1627
import sys sys.setrecursionlimit(250000) from scipy.special import comb # a = comb(n, r) def main(): # a,b,c,d = map(int, input().split()) n = int(input()) sum = 10**n - 9**n*2 + 8**n # temp = (10 ** 9 + 7) # sum = 0 # if n >= 2: # for i in range(2, n+1): # a = int(comb(i,...
s877679853
p02554
u789622053
1600033475
Python
PyPy2 (7.3.0)
py
Runtime Error
1767
865844
342
from sys import setrecursionlimit setrecursionlimit(1<<30) def f(i,b1,b2): if i==n: return b1 and b2 if z[i][b1][b2]==-1: z[i][b1][b2]=sum(f(i+1,b1 or j==0,b2 or j==9) for j in xrange(10))%(pow(10,9)+7) return z[i][b1][b2] n=input() z=[[[-1 for _1 in xrange(2)] for _2 in xrange(2)] for _3 in xrange(n+1)] ...
s832719811
p02554
u550289743
1600032695
Python
Python (3.8.2)
py
Runtime Error
24
8948
111
N = input() satisfied_pattern = 10**N - (2*(9**N) - 8**N) output = satisfied_pattern % (10**9+7) print(output)
s468328201
p02554
u601218364
1600032290
Python
PyPy3 (7.3.0)
py
Runtime Error
125
68668
68
N=int(input()) ans=10**n-2*(9**n)+8**n ans=ans%1000000007 print(ans)
s365762855
p02554
u941407962
1600032162
Python
PyPy3 (7.3.0)
py
Runtime Error
92
68780
82
a, b, c, d = list(map(int, input().split())) R=max([b*d, a*d, a*c, b*c]) print(R)
s658667383
p02554
u436519884
1600031850
Python
PyPy3 (7.3.0)
py
Runtime Error
94
68748
121
n=int(input()) mod=10**9+7 exlcusion=2*pow(9,n,mod)-pow(8,n,mod) total=pow(10,n,mod) ans=total-exclusion%mod print(total)
s381562688
p02554
u013617325
1600031623
Python
Python (3.8.2)
py
Runtime Error
24
9016
711
#!/usr/bin/env python3 import sys MOD = 1000000007 # type: int def solve(N: int): return print((10**N - 2*9**N + 8**N)) # Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools (tips: You use the default template now. You can remove this line by using your custom template) def main(): def ite...
s117957704
p02554
u686036872
1600031571
Python
Python (3.8.2)
py
Runtime Error
23
9060
102
N = int(input()) a=pow(10,n,10**9+7) b=pow(9,n,10**9+7) c=pow(8,n,10**9+7) print((a-2*b+c)%(10**9+7))
s953602551
p02554
u928758473
1600030981
Python
Python (3.8.2)
py
Runtime Error
393
11500
484
import os import sys from collections import defaultdict, Counter from itertools import product, permutations,combinations, accumulate from operator import itemgetter from bisect import bisect_left,bisect from heapq import heappop,heappush,heapify from math import ceil, floor, sqrt, factorial from copy import deepcopy ...
s881051675
p02554
u762533651
1600030776
Python
PyPy3 (7.3.0)
py
Runtime Error
127
68540
124
n = int(input()) mod = 10 ** 9 + 7 re = (10 ** n) - (2 * (9 ** n)) - (8 ** n) if n = 1: print(0) else: print(re)
s006683005
p02554
u868281230
1600030675
Python
Python (3.8.2)
py
Runtime Error
30
9096
134
n = input() mod = 10**9 + 7 ans = (pow(10, n, mod) - ((2 * pow(9, n, mod)) % mod - pow(8, n, mod) + mod) % mod + mod) % mod print(ans)
s113677031
p02554
u984960045
1600030513
Python
PyPy3 (7.3.0)
py
Runtime Error
105
68524
80
n=int(input()) mod=10**9+7 print((pow(10,n,mod)-2*pow(9,n,mod)+pow(8,n,mod)%mod)
s052521443
p02554
u698916859
1600030154
Python
Python (3.8.2)
py
Runtime Error
2206
11052
88
# 整数の入力 N = int(input()) print((10 ** N - 2* 9 **N + 8 ** N)) % (10 ** 9 + 7)
s702768381
p02554
u561294476
1600030060
Python
Python (3.8.2)
py
Runtime Error
24
8944
65
N = int(input()) print((10**N -9**N -9**N +8**N)% (10**9+7))
s818375789
p02554
u452512115
1600029645
Python
Python (3.8.2)
py
Runtime Error
32
9628
1302
import math import itertools def fact(n): if (n <= 1): return 1 return n * fact(n - 1) def nPr(n, r): return math.floor(fact(n) / fact(n - r)) from math import * # Function to find the nCr def printNcR(n, r): # p holds the value of n*(n-1)...
s421146796
p02554
u086644516
1600029597
Python
Python (3.8.2)
py
Runtime Error
27
8880
334
N = int(input()) MOD = 1000000000 + 7 def power_func(a,n,p): bi = str(format(n,"b"))#2進表現に res = 1 for i in range(len(bi)): res = (res*res) %p if bi[i] == "1": res = (res*a) %p return res print(str((power_func(10, N, MOD) - 2 * power_func(9, N, MOD) + power_func(8, N, MOD) % ...
s006579941
p02554
u959682393
1600029597
Python
Python (3.8.2)
py
Runtime Error
58
25116
320
N = int(input()) cnt = N*(N-1) less = 8 ** (N-2) d = 10**9 + 7 ans = cnt * less x=N-2 for i in range(x+1): for j in range(x+1): if i == 0 and j ==0: continue if i + j <= x: l = [0]*(1+i) +[9]*(1+j) +[-1]*(x-i-j) ans += len(set(list(itertools.permutations(l, N)))) print(ans%d)
s600048093
p02554
u452512115
1600029595
Python
Python (3.8.2)
py
Runtime Error
29
9656
1301
import math import itertools def fact(n): if (n <= 1): return 1 return n * fact(n - 1) def nPr(n, r): return math.floor(fact(n) / fact(n - r)) from math import * # Function to find the nCr def printNcR(n, r): # p holds the value of n*(n-1)...
s255591205
p02554
u811629303
1600029590
Python
Python (3.8.2)
py
Runtime Error
1173
128096
1168
# # 178C # import math import sys MOD = 10**9+7 num = input() n = int(num) def cmb(n, r, p): if (r < 0) or (n < r): return 0 r = min(r, n - r) return fact[n] * factinv[r] * factinv[n-r] % p p = 10 ** 9 + 7 N = 10 ** 6 # N は必要分だけ用意する fact = [1, 1] # fact[n] = (n! mod p) factinv = [1, 1] # facti...
s394860219
p02554
u273339216
1600029572
Python
Python (3.8.2)
py
Runtime Error
228
42892
411
from scipy.special import perm n = int(input()) def re_factorial(n): if n < 2: return 1 return n * re_factorial(n-1) mas = n-2 # 0と9は必ず使う #print(perm(n, 2)) if mas == 0: print(2) elif n == 0: print(1) else: #res = (permutations_count(n, 2) * 10^mas)%(10^9 + 7) res = (re_factorial(n)%1000000007 *...
s283954933
p02554
u468431843
1600029568
Python
Python (3.8.2)
py
Runtime Error
2206
15032
243
import math def permutations_count(n, r): return (math.factorial(n) // math.factorial(n - r)) % mod N = int(input()) mod = 10**9 + 7 ans = ((permutations_count(N, 2) * (8 ** (N - 2))) + permutations_count(N, 2)) % mod print(ans % mod)
s929610451
p02554
u208394180
1600029558
Python
Python (3.8.2)
py
Runtime Error
28
9624
145
def P(x): if x == 0: return 1 return x * P(x - 1) N = int(input()) if N == 1: print(0) else: print(P(N) * 9**(N-2))
s779232164
p02554
u238504302
1600029550
Python
Python (3.8.2)
py
Runtime Error
513
42432
174
from scipy.special import comb as c N = int(input()) if N == 1: print(0) else: ans = 0 for i in range(1, N): ans += c(i+1, N-1, exact=True) print(ans % (10 ** 9 + 7))
s201110826
p02554
u634131849
1600029547
Python
Python (3.8.2)
py
Runtime Error
414
9144
129
MOD = 1000000007 n = int(input()) a = 1 b=1 c=1 for i in range(n): a=a*10%MOD b=b*9%MOD c=c*8%MOD print (a-2*b+c)%MOD
s448835957
p02554
u698916859
1600029524
Python
Python (3.8.2)
py
Runtime Error
2206
14888
219
import math def combinations_count(N, r): return math.factorial(N) // (math.factorial(N - r) * math.factorial(r)) # 整数の入力 N = int(input()) r = 2 print(combinations_count(N, r) * 10**(N-r) % (10**9 +7))
s153179745
p02554
u514343483
1600029524
Python
Python (3.8.2)
py
Runtime Error
30
9208
319
N=int(input()) if N==1: print(0) elif N==2: a=8 print(a) elif N==3: b=28 print(a+b) elif N==4: c=56 print(a+b+c) elif N==5: d=70 print(a+b+c+d) elif N==6: print(a+b+c+d+c) elif N==7: print(a+b+c+d+c+b) elif N==8: print(a+b+c+d+c+b+a) elif N==9: print(a+b+c+d+c+b+a+1)
s008020500
p02554
u460745860
1600029521
Python
Python (3.8.2)
py
Runtime Error
35
9664
314
def cal(N): for n in range(3,N+1): left = N - n right = n if left < 6: return 1 else: return 1 + cal(left) if right < 6: return 1 else: return 1 + cal(right) S = int(input()) if S < 3: print(0) exit() else: ans = cal(S) print((1+ans)%dekai())
s770076906
p02554
u551437236
1600029519
Python
Python (3.8.2)
py
Runtime Error
892
176100
538
import sys sys.setrecursionlimit(100000) N = int(input()) p = 10**9+7 ans = 0 nCr = {} def cmb(n, r, p): if r == 0 or r == n: return 1 if r == 1: return n%p if (n,r) in nCr: return nCr[(n,r)]%p nCr[(n,r)] = (cmb(n-1,r, p) + cmb(n-1,r-1, p))%p return nCr[(n,r)] sl = [1] egtl = [1] for i in range(N...
s496422232
p02554
u208394180
1600029513
Python
Python (3.8.2)
py
Runtime Error
31
9644
180
# coding: utf-8 # Your code here! def P(x): if x == 0: return 1 return x * P(x - 1) N = int(input()) if N == 1: print(0) else: print(P(N) * 9**(N-2))
s866589846
p02554
u273339216
1600029509
Python
Python (3.8.2)
py
Runtime Error
224
42608
378
from scipy.special import perm n = int(input()) def re_factorial(n): if n < 2: return 1 return n * re_factorial(n-1) mas = n-2 # 0と9は必ず使う #print(perm(n, 2)) if mas == 0: print(2) elif n == 0: print(1) else: #res = (permutations_count(n, 2) * 10^mas)%(10^9 + 7) res = (re_factorial(n) * int(perm(n...
s944938981
p02554
u498677593
1600029500
Python
PyPy3 (7.3.0)
py
Runtime Error
334
85732
220
def func(a): if (a==1): return 0 else: return func(a-1)+a N=int(input()) S=10**9+7 if N==1: z=0 elif N==2: z=2 else: z=((10**(N-2) *N*2) - (10**(N-3) * ((6+func(N-2))))) %S print(z)
s387889099
p02554
u827261928
1600029469
Python
PyPy3 (7.3.0)
py
Runtime Error
240
75888
73
mod =10**9 + 7 N=int(input()) a=10**N b=a*((8/10)**N) print(int(a-b)/mod)
s460279140
p02554
u698916859
1600029444
Python
Python (3.8.2)
py
Runtime Error
2206
14832
193
import math def combinations_count(N, r): return math.factorial(N) // (math.factorial(N - r) * math.factorial(r)) # 整数の入力 N = int(input()) r = 2 print(combinations_count(N, r))
s146019700
p02554
u055127677
1600029436
Python
Python (3.8.2)
py
Runtime Error
30
9620
195
n=int(input()) def solve(n): if n==1: return 1 return n*solve(n-1) mod = 10 ** 9 + 7 if n==1: print(0) elif n==2: print(2) else: x=(10*(n-2)*solve(n))%mod print(x)
s209021686
p02554
u424661377
1600029417
Python
Python (3.8.2)
py
Runtime Error
2225
619368
241
import sys sys.setrecursionlimit(1000000) def factorial(n): if n <= 0: return 1 if n == 1: return n return n * factorial(n-1) s = int(input()) ans = (s * (s - 1)) * factorial(s - 2) ans %= 1000000007 print(ans)
s043507155
p02554
u966542724
1600029392
Python
Python (3.8.2)
py
Runtime Error
46
10660
312
from operator import mul from functools import reduce def cmb(n,r): r = min(n-r,r) if r == 0: return 1 over = reduce(mul, range(n, n - r, -1)) under = reduce(mul, range(1,r + 1)) return over // under n = int(input()) a = cmb(n,2)*2 b = (8**(n-2)) d = (2**n) -2 print((a*b+d)%1000000007)
s644292581
p02554
u698916859
1600029369
Python
Python (3.8.2)
py
Runtime Error
23
9100
205
def combinations_count(N, r): return math.factorial(N) // (math.factorial(N - r) * math.factorial(r)) # 整数の入力 N = int(input()) r = 2 print(combinations_count(N, r) * 10**(N-r) % (10**9 +7))
s413118301
p02554
u348538363
1600029357
Python
Python (3.8.2)
py
Runtime Error
28
9088
205
S = input() L = int(S) D = L-2 A = int(D) G = L-1 Z = int(G) B = L-3 V = int(B) if L==0: print(0) elif L==1: print(0) elif L==2: print(2) elif L>=3: print((10*A*Z+8*U+10*B)%(10**9+7))
s664187487
p02554
u246448955
1600029355
Python
PyPy3 (7.3.0)
py
Runtime Error
109
68616
93
import math N = int(input()) if N>2: print((math.factrial(N)*10)%(10**9+7)) else: print(N)
s702177154
p02554
u404842368
1600029292
Python
Python (3.8.2)
py
Runtime Error
295
28284
219
import numpy as np N = int(input()) MOD = 1000000007 if N==1 or N==0: ans=0 elif N==2: ans =2 else: ans = ( ( N*(N-1) ) %MOD ) * ( ( 10**(N-2) - (N-2)*(N-3)/2 )%MOD) ans = ans % MOD print(ans)
s574325935
p02554
u807692288
1600029282
Python
Python (3.8.2)
py
Runtime Error
28
9800
725
# -*- coding: utf-8 -*- import math result = 0 def meso(x): #print("x = ",x) y = 0 kurikaeshi = (math.floor(x / 2) - 3) + 1 #print("loop=" ,kurikaeshi) for i in range(kurikaeshi): icode = i + 3 #print("icode=", icode) if icode >= 6 or x - icode >= 6: #print("...
s146400538
p02554
u246448955
1600029275
Python
PyPy3 (7.3.0)
py
Runtime Error
154
74740
62
import math N = int(input()) print(math.factrial(N)%(10**9+7))
s208366607
p02554
u561294476
1600029254
Python
Python (3.8.2)
py
Runtime Error
2206
14908
800
import math def combinations_count(n, r): return math.factorial(n) // (math.factorial(n - r) * math.factorial(r)) N = int(input()) all = 0 for i in range(2, N//2+1): basyo = combinations_count(N, i) # iとN-iの時、値が同じ zero_iti = 2 ** (3 * N - 2 * i - 1) # i=iの時 zero_iti2 = 2 ** (N + 2 * i - 1) # i...
s199128004
p02554
u273339216
1600029230
Python
Python (3.8.2)
py
Runtime Error
216
42784
377
from scipy.special import perm n = int(input()) def re_factorial(n): if n < 2: return 1 return n * re_factorial(n-1) mas = n-2 # 0と9は必ず使う #print(perm(n, 2)) if mas == 0: print(2) elif n == 0: print(1) else: #res = (permutations_count(n, 2) * 10^mas)%(10^9 + 7) res = (re_factorial(n) * int(perm(n...
s889507490
p02554
u539248699
1600029157
Python
Python (3.8.2)
py
Runtime Error
31
9060
308
n = int(input()) num = 0 x = n#0,9が置かれる場所 y = 0#0,9の選び方 z = 8 * (n - 1)#それ以外の選び方 for i in range(2,n + 1):#0,9の個数 x * (n - i + 1) // i y = (y + 2) * 2 - 2 z = z // 8 num += ((x % (10 ** 9 + 7)) * ((y * z) % (10 ** 9 + 7)) print(num % (10 ** 9 + 7))
s061646349
p02554
u135265051
1600029050
Python
Python (3.8.2)
py
Runtime Error
2206
14904
511
import math # import statistics import itertools a=int(input()) #b,c=int(input()),int(input()) # c=[] # for i in a: # c.append(int(i)) # e1,e2,e3,e4 = map(int,input().split()) #f = list(map(int,input().split())) # g = [input() for _ in range(a)] def permutations_count(n): return math.factorial(n) ya=a-2 con = p...
s407354315
p02554
u690626617
1600028996
Python
Python (3.8.2)
py
Runtime Error
210
10404
126
N = int(input()) if N == 2: ans = 2 elif N ==1: ans = 0 else: ans = 10**(N-2) ans = int(ans%(10e9+7)) print(ans)
s883745922
p02554
u698916859
1600028963
Python
Python (3.8.2)
py
Runtime Error
201
10520
86
# 整数の入力 N = int(input()) print((10 ** (N-2) * N * (N-1) / 2) % (10**9 + 7))
s792297253
p02554
u516050812
1600028949
Python
Python (3.8.2)
py
Runtime Error
2206
49600
203
inp = int(input()) if inp == 1: print(0) else: all = 10 ** inp none = 8 ** inp a = sum([i * 8 for i in range(1,inp-1)]) + 1 frag = 2 * 9 ** (inp-1) * inp - a * 2 print(all - none - frag)
s583424013
p02554
u324918230
1600028891
Python
PyPy3 (7.3.0)
py
Runtime Error
2210
169272
813
from math import factorial N = int(input()) if N == 1: ans = 0 else: # N == 3 # [[0|9], [0|9], [1-8]] = (3! * 8^1 * (2^2 - 2)) / 2! * 1! # [[0|9], [0|9], [0|9]] = (3! * 8^0 * (2^3 - 2)) / 3! * 0! # N == 4 # [[0|9], [0|9], [1-8], [1-8]] = (4! * 8^2 * (2^2 - 2)) / 2! * 2! # [[0|9], [0|9], [0|...
s171763982
p02554
u424661377
1600028802
Python
Python (3.8.2)
py
Runtime Error
32
9684
163
def factorial(n): if n == 1: return n return n * factorial(n-1) s = int(input()) ans = (s * (s - 1)) * factorial(s-2) ans %= 1000000007 print(ans)
s319556640
p02554
u424661377
1600028792
Python
Python (3.8.2)
py
Runtime Error
29
9020
159
def factorial(n): if n == 1: return n return n * kaijo(n-1) s = int(input()) ans = (s * (s - 1)) * factorial(s-2) ans %= 1000000007 print(ans)
s200910845
p02554
u498531348
1600028785
Python
PyPy3 (7.3.0)
py
Runtime Error
2211
168660
966
import math from math import factorial # a = comb(n, r) N = int(input()) a = factorial(N) / factorial(N-2) / factorial(N - (N-2)) B = 0 def power_func(a,n,p): bi = str(format(n,"b"))#2進表現に res = 1 for i in range(len(bi)): res = (res*res) %p if bi[i] == "1": res = (res*a...
s566697629
p02554
u453529685
1600028744
Python
Python (3.8.2)
py
Runtime Error
2206
15000
163
N = int(input()) import math def comb(n, r): return math.factorial(n) // (math.factorial(n - r) * math.factorial(r)) print((comb(N,2)*2*(9**(N-2)))%(10**9+7))
s993465333
p02554
u453529685
1600028645
Python
Python (3.8.2)
py
Runtime Error
2206
15040
160
N = int(input()) import math def comb(n, r): return math.factorial(n) // (math.factorial(n - r) * math.factorial(r)) print((comb(N,2)*2*9**(N-2))%(10**9+7))
s612509046
p02554
u811202694
1600028605
Python
Python (3.8.2)
py
Runtime Error
26
9024
4539
// Template: https://github.com/maitaken/atcoder-template package main import ( "bufio" "fmt" "math" "os" "strconv" "strings" ) const ( BUFSIZE = 10000000 MOD = 1000000007 INT_INF = math.MaxInt32 ) var rdr *bufio.Reader func main() { rdr = bufio.NewReaderSize(os.Stdin, BUFSIZE) solve() } func solve(...
s105391807
p02554
u498677593
1600028495
Python
PyPy3 (7.3.0)
py
Runtime Error
302
85800
216
def func(a): if (a==0): return 6 else: return func(a-1)+2 N=int(input()) S=10**9+7 if N==1: z=0 elif N==2: z=2 else: z=((10**(N-2) *N*2) - (10**(N-3) * (func(N-3)))) %S print(z)
s862020763
p02554
u941645670
1600028367
Python
Python (3.8.2)
py
Runtime Error
206
10384
130
n = int(input()) n_all = 10**(n) % mod bad_0 = 9**(n)%mod bad_9 = 9**(n)%mod bad_18 = 8**(n)%mod print(n_all-bad_0-bad_9+bad_18)
s214258072
p02554
u288335507
1600028227
Python
PyPy3 (7.3.0)
py
Runtime Error
114
68628
222
n = int(input()) def p(m, n): k = 1 for i in range(n): k = (k * m) % (10**9 + 7) return k x = p(10, n) - 2*p(9, n) + p(8, n) while x < 0: x += 10 ** 9 + 7 elif x == 10 ** 9 + 7: x = 0 print(x)
s007556740
p02554
u175720502
1600028147
Python
Python (3.8.2)
py
Runtime Error
593
619460
245
import sys sys.setrecursionlimit(1000000) def pow_r(x, n): if n == 0: return 1 # exit case else: return x * pow_r(x, n - 1) % 1000000007 n=int(input()) m = n * (n-1) % 1000000007 m = m * pow_r(8,n-2) % 1000000007 print(m)
s257736398
p02554
u806988802
1600028014
Python
Python (3.8.2)
py
Runtime Error
932
11880
170
n = int(input()) n_zero = 10**n - 9**n #19 n_nine = 10**n - 9**n #19 n_non_zn = 8**n #64 a = (10**n - n_zero - n_nine - n_zn) if a < 0: a = -a print(a % (10**9+7))
s524793757
p02554
u455809703
1600027875
Python
PyPy3 (7.3.0)
py
Runtime Error
2339
3530232
419
def make_comb_dp(n): dp = [[0] * (n + 1) for i in range(n + 1)] for i in range(n + 1): dp[i][0] = 1 dp[i][i] = 1 for i in range(2, n + 1): for j in range(1, i): dp[i][j] = dp[i - 1][j - 1] + dp[i - 1][j] return dp N = int(input()) a = 0 for n, i in enumerate(make_co...
s372274337
p02554
u052244548
1600027803
Python
Python (3.8.2)
py
Runtime Error
2206
15820
463
import itertools import functools import math from collections import Counter from itertools import combinations import re import sys N=int(input()) if N <= 1: print('0') elif N == 2: print('2') else: ans1 = 2**N - 2 ans2 = 0 for i in range(N-2): ans2 = math.factorial(N) / ( math.factoria...
s664192488
p02554
u551437236
1600027736
Python
Python (3.8.2)
py
Runtime Error
310
97300
462
import sys sys.setrecursionlimit(100000) N = int(input()) p = 10**9+7 ans = 0 comb = 1 s = 1 i = 0 j = N nCr = {} def cmb(n, r, p): if r == 0 or r == n: return 1 if r == 1: return n%p if (n,r) in nCr: return nCr[(n,r)]%p nCr[(n,r)] = (cmb(n-1,r, p) + cmb(n-1,r-1, p))%p return nCr[(n,r)] while j>=2:...
s308441516
p02554
u707960254
1600027665
Python
PyPy3 (7.3.0)
py
Runtime Error
131
74704
131
N = int(input()) mod = int(1e9 +7) ans = pow(10, N, mod=mod) ans -= 2*pow(9, N, mod=mod) ans += pow(8, N, mod=mod) print(ans%mod)
s366410445
p02554
u087118202
1600027566
Python
PyPy3 (7.3.0)
py
Runtime Error
87
74548
211
n=int(input()) def cc(n, r): return math.factorial(n) // (math.factorial(n - r) * math.factorial(r)) if n<2: print(0) elif n==2: print(2) else: cc_=cc(n,2) ans=cc_ * 9 * 2 print(ans%(10**9+7))
s920706544
p02554
u694536861
1600027547
Python
Python (3.8.2)
py
Runtime Error
209
10940
403
import math from operator import mul from functools import reduce def cmb(n,r): r = min(n-r,r) if r == 0: return 1 over = reduce(mul, range(n, n - r, -1)) under = reduce(mul, range(1,r + 1)) return over // under N = int(input()) answer = 0 rest = 10 ** 9 + 7 if N == 1: answer = 0 else: ans...
s885746234
p02554
u087118202
1600027528
Python
PyPy3 (7.3.0)
py
Runtime Error
95
68700
211
n=int(input()) def cc(n, r): return math.factorial(n) // (math.factorial(n - r) * math.factorial(r)) if n<2: print(0) elif n==2: print(2) else: cc_=cc(n,2) ans=cc_ * 9 * 2 print(ans%(10**9+7))
s821911898
p02554
u650219658
1600027506
Python
Python (3.8.2)
py
Runtime Error
2206
15160
300
import math result = 0 n = int(input()) for zeros in range(1,n+1): for nines in range(1,n+1): if zeros + nines > n: break else: result = result + (8**(n-zeros-nines) * (math.factorial(n) / (math.factorial(zeros) * math.factorial(nines)))) print(result % (10**9 + 7) )
s792155477
p02554
u786325650
1600027151
Python
Python (3.8.2)
py
Runtime Error
390
10496
159
N = int(input()) if N<(10**6): a=(10**N)%(10**9+7) b=(9**N)%(10**9+7) c=(8**N)%(10**9+7) print((a+c-2*b)%(10**9+7)) else: print((a+c-2*b)%(10**9+7))
s785019651
p02554
u731461064
1600027121
Python
Python (3.8.2)
py
Runtime Error
27
9220
333
a,b,c,d = map(int, input().split()) if a >= 0 and c >= 0: print(b*d) elif b <= 0 and d <= 0: print(a*c) elif a < 0 and c < 0: if b<=0 or d<=0: print(a*c) elif abs(a)>=abs(b) and abs(c)>=abs(d): print(a*c) else: print(b*d) elif (b<0 and c>=0): print(b*c) elif (a>=0 and d<0): print(a*d) else:...
s476020085
p02554
u770293614
1600026863
Python
Python (3.8.2)
py
Runtime Error
200
10592
162
N=int(input()) if N<2: print(0) elif N==2: print(2) else: without=10**(N-2) each=N*(N-1)/2 final=without*each considered=final%(1000000007) print(final)
s506512814
p02554
u770293614
1600026824
Python
Python (3.8.2)
py
Runtime Error
207
10456
162
N=int(input()) if N<2: print(0) elif N==2: print(2) else: without=10**(N-2) each=N*(N-1)/2 final=without*each considered=final%(1000000007) print(final)
s524869072
p02554
u219305322
1600026823
Python
Python (3.8.2)
py
Runtime Error
25
9040
143
n = input() MOD = 1000000007 a1 = ((n%MOD)*((n-1)*MOD))%MOD a2 = 1 for i in range(n-2): a2 = ((a2%MOD)*10)%MOD print(((a1%MOD)*(a2%MOD))%MOD)
s155724799
p02554
u240234332
1600026777
Python
Python (3.8.2)
py
Runtime Error
222
10564
94
N = int(input()) x = 10**N - 8**N - (2/7) * ((8/7) * (8**N-1) - N) y = 10**9 + 7 print(x % y)
s914041106
p02554
u698916859
1600026768
Python
Python (3.8.2)
py
Runtime Error
207
10472
85
# 整数の入力 N = int(input()) print( (10**(N-2) * N * (N-1) -7) / (10**9 + 7))
s562878740
p02554
u220545090
1600026710
Python
Python (3.8.2)
py
Runtime Error
27
8868
121
n = int(input()) if n == 0 or n == 1: print(0) elif n == 2: print(2): else: print((n * (n - 1) / 2) * 10 * (n - 2))
s650515099
p02554
u359067113
1600026688
Python
PyPy3 (7.3.0)
py
Runtime Error
118
68704
96
n=int(input()) for i in range(1,n + 1): fac = fac*i c=10**(n-2) print((fac*c)%1000000007)
s849878679
p02554
u476674874
1600026539
Python
Python (3.8.2)
py
Runtime Error
2226
619240
754
import sys import math sys.setrecursionlimit(10**6) MOD = 10**9 + 7 def mod_pow(x, mod): xx = [1, x] def _pow(y, x=x): nonlocal xx if y == 0: return 1 while len(xx) <= math.log(y, 2)+1: v = xx[-1] * xx[-1] v %= mod xx.append(v) i =...
s417021263
p02554
u059940903
1600026503
Python
PyPy3 (7.3.0)
py
Runtime Error
370
85760
113
N = int(input()) if N <= 1: print(0) else: res = (10**N - 8**N - 2 * (9**N - 8**N)) % mod print(int(res))
s023481420
p02554
u945342410
1600026495
Python
Python (3.8.2)
py
Runtime Error
24
9148
107
import math n = int(input()) ans = math.factorial(10) / math.factorial(10 - (n-2)) print(ans % (10**9 + 7))