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

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

I got a runtime error on the last Atcoder Regular Contest.

The problem is this .

My RE solution here .

Runtime Error Part
RE test case

I always wrote (char) ('a'+k)to get the kth letter from the alphabet and didn't get Runtime Error on any platform.

Why am I getting RE this time?

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

»
2 года назад, # |
  Проголосовать: нравится +6 Проголосовать: не нравится

RTE here:

if (xx >= 0 && xx < n && yy >= 0 && yy < m) {
	int d = ch[xx][yy] - '0';
	f[d] = 1;
}

when ch[xx][yy] = '.', d = -2. On my machine it somehow modify the value of m and cause RTE:|