Submission #2123747
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 | A - Two Integers |
User | takuya4880 |
Language | Python (2.7.6) |
Score | 0 |
Code Size | 789 Byte |
Status | RE |
Exec Time | 11 ms |
Memory | 2696 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 100 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | 0_000.txt, 0_001.txt |
All | 0_000.txt, 0_001.txt, 1_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 |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
0_000.txt | RE | 11 ms | 2696 KB |
0_001.txt | RE | 11 ms | 2696 KB |
1_002.txt | RE | 11 ms | 2696 KB |
1_003.txt | RE | 11 ms | 2696 KB |
1_004.txt | RE | 11 ms | 2696 KB |
1_005.txt | RE | 11 ms | 2696 KB |
1_006.txt | RE | 11 ms | 2696 KB |
1_007.txt | RE | 11 ms | 2696 KB |
1_008.txt | RE | 11 ms | 2696 KB |
1_009.txt | RE | 11 ms | 2696 KB |
1_010.txt | RE | 11 ms | 2696 KB |
1_011.txt | RE | 11 ms | 2696 KB |
1_012.txt | RE | 11 ms | 2696 KB |
1_013.txt | RE | 11 ms | 2696 KB |
for_sample.txt | RE | 11 ms | 2696 KB |