Submission #2123748
Source Code Expand
class State: def __init__(self, n, c0, c1): self.n = len(c0) self.c0 = c0 self.c1 = c1 self.nok = 0 def operate(self): for i in xrange(self.nok,self.n): if(self.c0[i]<self.c1[i] or i==self.n-1): self.c0[i] += 2 break for i in xrange(self.nok,self.n): if(self.c0[i]>self.c1[i] or i==self.n-1): self.c1[i] += 1 if(self.c0[i]==self.c1[i]): self.nok = i break if __name__=='__main__': n = int(raw_input()) c0 = map(int, raw_input().split()) c1 = map(int, raw_input().split()) nop = sum(c1) - sum(c0) s = State(n, c0, c1) for i in xrange(nop): s.operate() print s.c0 print s.c1 if (c0==c1): print 'Yes' else: print 'No'
Submission Info
Submission Time | |
---|---|
Task | B - Two Arrays |
User | takuya4880 |
Language | Python (2.7.6) |
Score | 0 |
Code Size | 789 Byte |
Status | RE |
Exec Time | 2104 ms |
Memory | 134604 KB |
Judge Result
Set Name | Sample | All | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 300 | ||||||||||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | 0_000.txt, 0_001.txt, 0_002.txt |
All | 0_000.txt, 0_001.txt, 0_002.txt, 1_003.txt, 1_004.txt, 1_005.txt, 1_006.txt, 1_007.txt, 1_008.txt, 1_009.txt, 1_010.txt, 1_011.txt, 1_012.txt, 1_013.txt, 1_014.txt, 1_015.txt, 1_016.txt, 1_017.txt, 1_018.txt, 1_019.txt, 1_020.txt, 1_021.txt, 1_022.txt, 1_023.txt, 1_024.txt, 1_025.txt, 1_026.txt, 1_027.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
0_000.txt | WA | 11 ms | 2696 KB |
0_001.txt | WA | 10 ms | 2696 KB |
0_002.txt | AC | 11 ms | 2696 KB |
1_003.txt | TLE | 2103 ms | 75880 KB |
1_004.txt | AC | 17 ms | 3460 KB |
1_005.txt | AC | 18 ms | 3816 KB |
1_006.txt | RE | 1876 ms | 134476 KB |
1_007.txt | AC | 18 ms | 3816 KB |
1_008.txt | AC | 18 ms | 3816 KB |
1_009.txt | AC | 18 ms | 3816 KB |
1_010.txt | AC | 18 ms | 3816 KB |
1_011.txt | AC | 18 ms | 3816 KB |
1_012.txt | RE | 1873 ms | 134604 KB |
1_013.txt | AC | 18 ms | 3816 KB |
1_014.txt | RE | 1873 ms | 134476 KB |
1_015.txt | AC | 20 ms | 3816 KB |
1_016.txt | RE | 1883 ms | 134476 KB |
1_017.txt | AC | 18 ms | 3816 KB |
1_018.txt | RE | 1876 ms | 134476 KB |
1_019.txt | AC | 18 ms | 3816 KB |
1_020.txt | RE | 1959 ms | 134396 KB |
1_021.txt | RE | 1960 ms | 134396 KB |
1_022.txt | RE | 1957 ms | 134396 KB |
1_023.txt | RE | 1961 ms | 134396 KB |
1_024.txt | TLE | 2104 ms | 104012 KB |
1_025.txt | TLE | 2104 ms | 103756 KB |
1_026.txt | TLE | 2104 ms | 103372 KB |
1_027.txt | TLE | 2104 ms | 104012 KB |