Блог пользователя YouCantTouchThis54

Автор YouCantTouchThis54, история, 4 года назад, По-английски

Hey so I was working on a problem recently and when I tested in custom invocation it worked.

When i submitted it didnt work?

Why would this happen?

Submission: 86015133 Problem: 344A - Magnets

Output On the single line of the output print the number of groups of magnets.

Code: ~~~~~ from sys import stdin, stdout def main(): n = int(stdin.readline()) l = 0 y = " " for x in range(0,n): y = stdin.readline() x = stdin.readline() if(x != y): l = l + 1 stdout.write(str(l+1)) main() ~~~~~

Image 1 Image 2

Please help, I have no idea what I'm doing wrong :(

Полный текст и комментарии »

  • Проголосовать: нравится
  • +8
  • Проголосовать: не нравится