1442021-01-31 21:01:02ncsBimmbamm (30)nimAccepted 30/304ms2188 KiB
import strutils
let n = stdin.readLine().parseInt()
let elv = ["SZAM", "BIMM", "BAMM", "BUMM"]
var ans = 0
for k in 1 .. n:
  let akt = stdin.readline().strip()
  let i =(if k mod 3 == 0: 1 else: 0) + (if k mod 5 == 0: 2 else: 0)
  if akt != elv[i]:
    ans = k
    break
echo ans

SubtaskSumTestVerdictTimeMemory
base30/30
1Accepted0/02ms1932 KiB
2Accepted0/03ms2000 KiB
3Accepted3/31ms2136 KiB
4Accepted3/31ms2112 KiB
5Accepted3/31ms2140 KiB
6Accepted3/32ms2180 KiB
7Accepted3/32ms2188 KiB
8Accepted3/32ms2068 KiB
9Accepted3/31ms2104 KiB
10Accepted3/32ms2056 KiB
11Accepted3/32ms2112 KiB
12Accepted3/34ms2188 KiB