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

Обсуждение задачи 1196. Экзамен по истории

I believe this judge is absurd
Послано fireyyouth 5 окт 2016 20:53
I tried binary search, harsh table, got TLE. then I thought using direct mapping table could get MLE, but never TLE, so i tried it, still TLE!!!tell me how could this code get TLE.
#include <iostream>
using namespace std;
char a[1000000001];
int main()
{
    int n;
    cin >> n;
    for (int i = 1; i <= n; ++i) {
        int j;
        cin >> j;
        a[j] = 1;
    }
    int m;
    cin >> m;
    int cnt= 0;
    for (int i = 1; i <= m; ++i) {
        int j;
        cin >> j;
        cnt += a[j];
    }
    cout << cnt;
}
Re: I believe this judge is absurd
Послано Oleg Baskakov 6 окт 2016 00:27
To start with, 1 billion might be a bit too huge of a number. Try 3 zeroes less maybe.
Re: I believe this judge is absurd
Послано ToadMonster 6 окт 2016 01:26
1) Try Visual C++ and c-style IO (printf/scanf)

2) http://acm.timus.ru/status.aspx?space=1&num=1196&author=184065 - run at 01:23:42
6 Oct 2016 - your program. MLE, as expected

Edited by author 06.10.2016 01:28
Re: I believe this judge is absurd
Послано Egor 21 окт 2016 11:57
Insert this string:

int main()
{
  ios::sync_with_stdio(false); // It will speed up reading process
}
Re: I believe this judge is absurd
Послано ToadMonster 21 окт 2016 13:02
It doesn't (significantly) speed up Visual C++, as for me.
Using C-style IO (printf/scanf) is more predictable.