Submission #1369657
Source Code Expand
import sys N=int(input()) A=list(map(int,input().split())) total=0 for i in range(N): total+=A[i] if total*2/((N+1)*N)%1!=0: print("NO") sys.exit() times=int(total*2/((N+1)*N)) if (times-A[0]+A[N-1])/N%1! or times-A[0]+A[N-1]<0=0: print("NO") sys.exit() B=(times-A[0]+A[N-1])/N for i in range(N-1): B+=(times-A[i+1]+A[i])/N if (times-A[i+1]+A[i])/N%1!=0 or times-A[i+1]+A[i]<0: print("NO") sys.exit() if B==times: print("YES") else: print("NO")
Submission Info
Submission Time | |
---|---|
Task | B - Boxes |
User | wkb89_ |
Language | Python (3.4.3) |
Score | 0 |
Code Size | 492 Byte |
Status | RE |
Exec Time | 17 ms |
Memory | 2940 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 500 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample1.txt, sample2.txt, sample3.txt |
All | sample1.txt, sample2.txt, sample3.txt, in1.txt, in10.txt, in11.txt, in12.txt, in13.txt, in14.txt, in15.txt, in16.txt, in17.txt, in18.txt, in19.txt, in2.txt, in20.txt, in21.txt, in22.txt, in23.txt, in24.txt, in25.txt, in26.txt, in27.txt, in3.txt, in4.txt, in5.txt, in6.txt, in7.txt, in8.txt, in9.txt, sample1.txt, sample2.txt, sample3.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
in1.txt | RE | 17 ms | 2940 KB |
in10.txt | RE | 17 ms | 2940 KB |
in11.txt | RE | 17 ms | 2940 KB |
in12.txt | RE | 17 ms | 2940 KB |
in13.txt | RE | 17 ms | 2940 KB |
in14.txt | RE | 17 ms | 2940 KB |
in15.txt | RE | 17 ms | 2940 KB |
in16.txt | RE | 17 ms | 2940 KB |
in17.txt | RE | 17 ms | 2940 KB |
in18.txt | RE | 17 ms | 2940 KB |
in19.txt | RE | 17 ms | 2940 KB |
in2.txt | RE | 17 ms | 2940 KB |
in20.txt | RE | 17 ms | 2940 KB |
in21.txt | RE | 17 ms | 2940 KB |
in22.txt | RE | 17 ms | 2940 KB |
in23.txt | RE | 17 ms | 2940 KB |
in24.txt | RE | 17 ms | 2940 KB |
in25.txt | RE | 17 ms | 2940 KB |
in26.txt | RE | 17 ms | 2940 KB |
in27.txt | RE | 17 ms | 2940 KB |
in3.txt | RE | 16 ms | 2940 KB |
in4.txt | RE | 17 ms | 2940 KB |
in5.txt | RE | 17 ms | 2940 KB |
in6.txt | RE | 17 ms | 2940 KB |
in7.txt | RE | 17 ms | 2940 KB |
in8.txt | RE | 17 ms | 2940 KB |
in9.txt | RE | 17 ms | 2940 KB |
sample1.txt | RE | 17 ms | 2940 KB |
sample2.txt | RE | 17 ms | 2940 KB |
sample3.txt | RE | 17 ms | 2940 KB |