Submission #2736255


Source Code Expand

import math

n,m = map(int,raw_input().split())
mod = 10**9+7
if abs(n-m) > 1:
	print 0

elif n-m ==1:
	print (math.factorial(n)*math.factorial(m))%mod

else :
	print (math.factorial(n)*math.factorial(m)*2)%mod

Submission Info

Submission Time
Task C - Reconciled?
User daleksprinter
Language Python (2.7.6)
Score 0
Code Size 221 Byte
Status WA
Exec Time 2103 ms
Memory 3148 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 300
Status
AC × 3
TLE × 1
AC × 8
WA × 2
TLE × 6
Set Name Test Cases
Sample s1.txt, s2.txt, s3.txt, s4.txt
All 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, 12.txt, s1.txt, s2.txt, s3.txt, s4.txt
Case Name Status Exec Time Memory
01.txt AC 10 ms 2568 KB
02.txt TLE 2103 ms 3148 KB
03.txt WA 10 ms 2568 KB
04.txt TLE 2103 ms 3148 KB
05.txt TLE 2103 ms 3092 KB
06.txt AC 10 ms 2568 KB
07.txt AC 10 ms 2568 KB
08.txt AC 10 ms 2568 KB
09.txt TLE 2103 ms 3092 KB
10.txt TLE 2103 ms 3100 KB
11.txt AC 10 ms 2568 KB
12.txt WA 10 ms 2568 KB
s1.txt AC 10 ms 2568 KB
s2.txt AC 11 ms 2568 KB
s3.txt AC 10 ms 2568 KB
s4.txt TLE 2103 ms 3148 KB