ENG  RUSTimus Online Judge
Online Judge
Задачи
Авторы
Соревнования
О системе
Часто задаваемые вопросы
Новости сайта
Форум
Ссылки
Архив задач
Отправить на проверку
Состояние проверки
Руководство
Регистрация
Исправить данные
Рейтинг авторов
Текущее соревнование
Расписание
Прошедшие соревнования
Правила
вернуться в форум

Обсуждение задачи 1224. Спираль

I’ve AC, but I still have a question!
Послано Veniamin 18 мар 2005 16:06
I’ve AC, but I still have a question!

My first program used “unsigned long” type, and didn’t pass Test 12

Then I changed all types to “unsigned long long” , and program was AC.

So, my question is why my first program failed on Test12?

As you know n,m<=2^31-1;So, the biggest result is 0xFFFFFFFD! This result can be represented by unsigned long!

So, I didn’t announce my program, because it is bad style. I’m sure that those programmers who solved this issue can understand my question….

Best Wishes,
Veniamin.
Re: I’ve AC, but I still have a question!
Послано [ za-Nuker ]™ 27 апр 2006 19:44
Each of n and m is <= 2^31-1. Yes, they are unsigned long.

But max unsigned long + 1 is? Overflow, of course !!

Your solution doesn't print n or m exactly but you have to calculate either 2*m or 2*n, aren't you?
Re: I’ve AC, but I still have a question!
Послано Pegasus 10 окт 2012 17:32
Thanks.I also meet this question.