Submission #3141859


Source Code Expand

Copy
#include <bits/stdc++.h>
using namespace std;

int memo[1000005] = {0};
int n, ans = 0;

int main() {
  int i, a, b;
  cin >> n;
  for(i = 0; i < n; ++i) {
    cin >> a >> b;
    ++memo[a];
    --memo[b + 1];
  }
  ans = memo[0];
  for(i = 1; i <= 1000000; ++i) {
    memo[i] += memo[i - 1];
    ans = max(ans, memo[i]);
  }

  cout << ans << endl;
  return 0;
}

Submission Info

Submission Time
Task C - AtColor
User m_tsubasa
Language C++14 (GCC 5.4.1)
Score 100
Code Size 384 Byte
Status
Exec Time 86 ms
Memory 4096 KB

Test Cases

Set Name Score / Max Score Test Cases
Sample 0 / 0 subtask0_sample01.txt, subtask0_sample02.txt
Subtask1 30 / 30 subtask1_01.txt, subtask1_02.txt, subtask1_03.txt, subtask1_04.txt, subtask1_05.txt, subtask1_06.txt, subtask1_07.txt, subtask1_08.txt, subtask1_09.txt, subtask1_10.txt, subtask1_11.txt, subtask1_12.txt, subtask1_13.txt, subtask1_14.txt, subtask1_15.txt, subtask0_sample01.txt, subtask0_sample02.txt
Subtask2 70 / 70 subtask0_sample01.txt, subtask0_sample02.txt, subtask1_01.txt, subtask1_02.txt, subtask1_03.txt, subtask1_04.txt, subtask1_05.txt, subtask1_06.txt, subtask1_07.txt, subtask1_08.txt, subtask1_09.txt, subtask1_10.txt, subtask1_11.txt, subtask1_12.txt, subtask1_13.txt, subtask1_14.txt, subtask1_15.txt, subtask2_01.txt, subtask2_02.txt, subtask2_03.txt, subtask2_04.txt, subtask2_05.txt, subtask2_06.txt, subtask2_07.txt, subtask2_08.txt, subtask2_09.txt, subtask2_10.txt, subtask2_11.txt, subtask2_12.txt, subtask2_13.txt, subtask2_14.txt, subtask2_15.txt, subtask2_16.txt, subtask2_17.txt, subtask2_18.txt, subtask2_19.txt, subtask2_20.txt, subtask2_21.txt, subtask2_22.txt, subtask2_23.txt, subtask2_24.txt, subtask2_25.txt
Case Name Status Exec Time Memory
subtask0_sample01.txt 5 ms 4096 KB
subtask0_sample02.txt 5 ms 4096 KB
subtask1_01.txt 4 ms 4096 KB
subtask1_02.txt 4 ms 4096 KB
subtask1_03.txt 6 ms 4096 KB
subtask1_04.txt 6 ms 4096 KB
subtask1_05.txt 6 ms 4096 KB
subtask1_06.txt 6 ms 4096 KB
subtask1_07.txt 6 ms 4096 KB
subtask1_08.txt 6 ms 4096 KB
subtask1_09.txt 6 ms 4096 KB
subtask1_10.txt 6 ms 4096 KB
subtask1_11.txt 6 ms 4096 KB
subtask1_12.txt 6 ms 4096 KB
subtask1_13.txt 6 ms 4096 KB
subtask1_14.txt 6 ms 4096 KB
subtask1_15.txt 6 ms 4096 KB
subtask2_01.txt 66 ms 4096 KB
subtask2_02.txt 82 ms 4096 KB
subtask2_03.txt 62 ms 4096 KB
subtask2_04.txt 78 ms 4096 KB
subtask2_05.txt 76 ms 4096 KB
subtask2_06.txt 83 ms 4096 KB
subtask2_07.txt 82 ms 4096 KB
subtask2_08.txt 82 ms 4096 KB
subtask2_09.txt 83 ms 4096 KB
subtask2_10.txt 82 ms 4096 KB
subtask2_11.txt 85 ms 4096 KB
subtask2_12.txt 83 ms 4096 KB
subtask2_13.txt 83 ms 4096 KB
subtask2_14.txt 82 ms 4096 KB
subtask2_15.txt 85 ms 4096 KB
subtask2_16.txt 82 ms 4096 KB
subtask2_17.txt 83 ms 4096 KB
subtask2_18.txt 82 ms 4096 KB
subtask2_19.txt 86 ms 4096 KB
subtask2_20.txt 84 ms 4096 KB
subtask2_21.txt 83 ms 4096 KB
subtask2_22.txt 83 ms 4096 KB
subtask2_23.txt 83 ms 4096 KB
subtask2_24.txt 83 ms 4096 KB
subtask2_25.txt 83 ms 4096 KB