Submission #524719


Source Code Expand

Copy
#include <stdio.h>

#define N 300000
#define M 100000

int main()
{
  int n,m,i,j;
  int from[M];
  int to[M];
  int room[N];
  int flag;
  int count = 0;

  scanf("%d %d", &n, &m);
  for(i=0;i<n;i++){
    room[i]=0;
  }
  
  for(i=0;i<m;i++){
    scanf("%d %d", &from[i], &to[i]);
    for(j=from[i]-1;j<to[i];j++){
      room[j]++;
    }
  }
  for(i=0;i<m;i++){
    flag = 1;
    for(j=from[i]-1;j<to[i];j++){
      if(room[j]<=1){
        flag = 0;
        break;
      }
    }
    if(flag > 0){
      count++;
    }
  }
  
  printf("%d\n", count);
  
  for(i=0;i<m;i++){
    flag = 1;
    for(j=from[i]-1;j<to[i];j++){
      if(room[j]<=1){
        flag = 0;
        break;
      }
    }
    if(flag > 0){
      printf("%d\n", i+1);
    }
  }
  
  return 0;
}

Submission Info

Submission Time
Task B - ドキドキデート大作戦高橋君
User inari
Language C (GCC 4.9.2)
Score 30
Code Size 816 Byte
Status
Exec Time 2034 ms
Memory 2600 KB

Compile Error

./Main.c: In function ‘main’:
./Main.c:15:3: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d %d", &n, &m);
   ^
./Main.c:21:5: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d %d", &from[i], &to[i]);
     ^

Judge Result

Set Name Sample Subtask1 All
Score / Max Score 0 / 0 30 / 30 0 / 70
Status
× 3
× 12
× 17
× 3
Set Name Test Cases
Sample subtask0_sample_01.txt, subtask0_sample_02.txt, subtask0_sample_03.txt
Subtask1 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, subtask0_sample_01.txt, subtask0_sample_02.txt, subtask0_sample_03.txt
All subtask0_sample_01.txt, subtask0_sample_02.txt, subtask0_sample_03.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, subtask2_01.txt, subtask2_02.txt, subtask2_03.txt, subtask2_04.txt, subtask2_05.txt, subtask2_06.txt, subtask2_07.txt, subtask2_08.txt
Case Name Status Exec Time Memory
subtask0_sample_01.txt 25 ms 692 KB
subtask0_sample_02.txt 25 ms 800 KB
subtask0_sample_03.txt 24 ms 796 KB
subtask1_01.txt 59 ms 2600 KB
subtask1_02.txt 111 ms 2596 KB
subtask1_03.txt 59 ms 2212 KB
subtask1_04.txt 85 ms 2084 KB
subtask1_05.txt 86 ms 2080 KB
subtask1_06.txt 24 ms 680 KB
subtask1_07.txt 24 ms 800 KB
subtask1_08.txt 23 ms 800 KB
subtask1_09.txt 23 ms 708 KB
subtask2_01.txt 2031 ms 1952 KB
subtask2_02.txt 2034 ms 1948 KB
subtask2_03.txt 23 ms 800 KB
subtask2_04.txt 22 ms 804 KB
subtask2_05.txt 23 ms 688 KB
subtask2_06.txt 23 ms 796 KB
subtask2_07.txt 23 ms 800 KB
subtask2_08.txt 2034 ms 1824 KB