https://codeforces.me/contest/1574/submission/129708228 whats wrong with this code can't know the edge case so, not able to know what is wrong.
| # | User | Rating |
|---|---|---|
| 1 | Benq | 3676 |
| 2 | Kevin114514 | 3659 |
| 3 | jiangly | 3640 |
| 4 | turmax | 3450 |
| 5 | tourist | 3408 |
| 6 | strapple | 3360 |
| 7 | Um_nik | 3354 |
| 8 | squareOf105 | 3348 |
| 9 | maroonrk | 3312 |
| 10 | idontwannadothis…e | 3191 |
| # | User | Contrib. |
|---|---|---|
| 1 | Qingyu | 153 |
| 2 | nik_exists | 151 |
| 3 | maroonrk | 150 |
| 4 | maspy | 149 |
| 5 | AmShZ | 146 |
| 6 | Um_nik | 143 |
| 7 | Errichto | 139 |
| 8 | adamant | 135 |
| 9 | BledDest | 134 |
| 10 | cry | 130 |
https://codeforces.me/contest/1574/submission/129708228 whats wrong with this code can't know the edge case so, not able to know what is wrong.
This is the code I wrote for this problem mentioned above
def mat(a,b,two): l=[] prevind=-1;i=-1;ctwo=0 for t in b: i+=1;ii=-1;dcoder="" if t=="2": ctwo+=1 m=["0" for t in range(a)] l.append(m) n=0 for tt in b: ii+=1 if i==ii: l[i][ii]="X" elif t=="1" and tt=="2": l[i][ii]="+" elif t=="1" and tt=="1": l[i][ii]="=" elif two==ctwo and t=="2" and tt=="2" and n==0: l[i][ii]="+" n+=1 elif t=="2" and tt=="2" and n==0 and ii>prevind: n+=1 prevind=ii l[i][ii]="+" else: l[i][ii]="-" dcoder+=l[i][ii] print(dcoder) for _ in range(int(input())): a=int(input()) b=input() ll=list(map(str,b)) two=ll.count("2") if two<3 and two!=0: print("NO") continue print("YES")
mat(a,b,two)
It is correct I tried on different IDE, but not showing right on codeforces. Why like that and if any error , please help me by letting me know what is it.
This is the code I wrote for the problem 'Calculating Function'
g=int(input()) if g%2==0: n=g/2 print(int((n*(n+1))-(n*n))) else: n=g//2; c=n+1 print(int((n*(n+1))-(c*c)))
It is correct but when I submitted it, it is showing wrong answer on test case 5. So I asked my friend and he did submit my code on codeforces from his account and it got accepted on his account. Why so?
| Name |
|---|


