Submission #1155637


Source Code Expand

#include<iostream>
#include<cstdio>
#include<string>
#include<algorithm>
#include<vector>
#include<list>
#include<map>
#include<set>
#include<unordered_map>
#include<unordered_set>
using namespace std;

int imos[300001];
int ruisekiWA[300001];
int x[100000], y[100000];
signed main() {
	int a, b; scanf("%d%d", &a, &b);
	for (int c = 0; c < b; c++) {
		int d, e; scanf("%d%d", &d, &e); d--;
		x[c] = d; y[c] = e;
		imos[d]++; imos[e]--;
	}
	int c = 0;
	for (int d = 0; d < a; d++) {
		c += imos[d];
		imos[d] = c;
	}
	for (int d = 1; d <= a; d++) {
		ruisekiWA[d] = ruisekiWA[d - 1];
		if (imos[d - 1] == 1)ruisekiWA[d]++;
	}
	vector<int>V;
	for (int i = 0; i < b; i++) {
		if (ruisekiWA[y[i]] - ruisekiWA[x[i]] == 0)V.push_back(i + 1);
	}
	printf("%d\n", V.size());
	for (int i : V) {
		printf("%d\n", i);
	}
}

Submission Info

Submission Time
Task B - ドキドキデート大作戦高橋君
User naoki2016
Language C++14 (GCC 5.4.1)
Score 100
Code Size 850 Byte
Status AC
Exec Time 29 ms
Memory 4472 KB

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:36:25: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘std::vector<int>::size_type {aka long unsigned int}’ [-Wformat=]
  printf("%d\n", V.size());
                         ^
./Main.cpp:17:33: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
  int a, b; scanf("%d%d", &a, &b);
                                 ^
./Main.cpp:19:34: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
   int d, e; scanf("%d%d", &d, &e); d--;
                                  ^

Judge Result

Set Name Sample Subtask1 All
Score / Max Score 0 / 0 30 / 30 70 / 70
Status
AC × 3
AC × 12
AC × 20
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 AC 1 ms 256 KB
subtask0_sample_02.txt AC 1 ms 256 KB
subtask0_sample_03.txt AC 1 ms 256 KB
subtask1_01.txt AC 20 ms 3328 KB
subtask1_02.txt AC 28 ms 4472 KB
subtask1_03.txt AC 19 ms 2560 KB
subtask1_04.txt AC 25 ms 2812 KB
subtask1_05.txt AC 25 ms 2812 KB
subtask1_06.txt AC 1 ms 256 KB
subtask1_07.txt AC 1 ms 256 KB
subtask1_08.txt AC 1 ms 256 KB
subtask1_09.txt AC 1 ms 256 KB
subtask2_01.txt AC 26 ms 4472 KB
subtask2_02.txt AC 28 ms 4472 KB
subtask2_03.txt AC 1 ms 256 KB
subtask2_04.txt AC 1 ms 256 KB
subtask2_05.txt AC 1 ms 256 KB
subtask2_06.txt AC 1 ms 256 KB
subtask2_07.txt AC 1 ms 256 KB
subtask2_08.txt AC 29 ms 3704 KB