#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);
}
}
./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--;
^