Submission #2504058
Source Code Expand
def inpchange(st): st2=st.replace("B","0") st3=st2.replace("W","1") return st3 N=int(input()) c=[0 for i in range(2*N)] a=[0 for i in range(2*N)] for i in range(2*N): c[i],a[i]=map(int,inpchange(input()).split()) ans=0 while(True): k=0 L=[0 for i in range(2*N)] for i in range(2*N-1): if L[i]==1: continue if a[i]>a[i+1]: a[i],a[i+1]=a[i+1],a[i] c[i],c[i+1]=c[i+1],c[i] k+=1 L[i]=1 L[i+1]=1 ans+=k if k==0: break print(ans)
Submission Info
Submission Time | |
---|---|
Task | E - Sorted and Sorted |
User | shakayami |
Language | Python (3.4.3) |
Score | 0 |
Code Size | 582 Byte |
Status | WA |
Exec Time | 2107 ms |
Memory | 3188 KB |
Judge Result
Set Name | Sample | All | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 600 | ||||||||||
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, 1_028.txt, 1_029.txt, 1_030.txt, 1_031.txt, 1_032.txt, 1_033.txt, 1_034.txt, 1_035.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
0_000.txt | AC | 17 ms | 3064 KB |
0_001.txt | WA | 17 ms | 3064 KB |
0_002.txt | WA | 17 ms | 3064 KB |
1_003.txt | WA | 17 ms | 3064 KB |
1_004.txt | AC | 17 ms | 3064 KB |
1_005.txt | WA | 17 ms | 3064 KB |
1_006.txt | WA | 17 ms | 3064 KB |
1_007.txt | WA | 17 ms | 3064 KB |
1_008.txt | WA | 17 ms | 3064 KB |
1_009.txt | AC | 17 ms | 3064 KB |
1_010.txt | AC | 17 ms | 3064 KB |
1_011.txt | WA | 17 ms | 3064 KB |
1_012.txt | AC | 17 ms | 3064 KB |
1_013.txt | AC | 17 ms | 3064 KB |
1_014.txt | TLE | 2104 ms | 3188 KB |
1_015.txt | WA | 756 ms | 3064 KB |
1_016.txt | TLE | 2104 ms | 3188 KB |
1_017.txt | WA | 1643 ms | 3064 KB |
1_018.txt | WA | 33 ms | 3064 KB |
1_019.txt | WA | 556 ms | 3064 KB |
1_020.txt | TLE | 2104 ms | 3188 KB |
1_021.txt | WA | 882 ms | 3064 KB |
1_022.txt | WA | 1090 ms | 3064 KB |
1_023.txt | AC | 28 ms | 3188 KB |
1_024.txt | TLE | 2104 ms | 3188 KB |
1_025.txt | TLE | 2104 ms | 3188 KB |
1_026.txt | TLE | 2104 ms | 3188 KB |
1_027.txt | TLE | 2104 ms | 3188 KB |
1_028.txt | TLE | 2104 ms | 3188 KB |
1_029.txt | TLE | 2104 ms | 3188 KB |
1_030.txt | TLE | 2104 ms | 3188 KB |
1_031.txt | TLE | 2104 ms | 3188 KB |
1_032.txt | TLE | 2107 ms | 3188 KB |
1_033.txt | TLE | 2104 ms | 3188 KB |
1_034.txt | AC | 32 ms | 3188 KB |
1_035.txt | TLE | 2104 ms | 3188 KB |