criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
using namespace std;

using QWORD = unsigned long long;
using SQWORD = long long;
using DWORD = unsigned int;
using SDWORD = int;
using WORD = unsigned short;
using SWORD = short;
using DOUBLE = double;
using FLOAT = float;

#define MIN_SDWORD (-2147483648)
#define MAX_SDWORD (2147483647)
#define ArrayLength(a)  (sizeof(a) / sizeof(a[0]))

static inline QWORD MAX(QWORD a, QWORD b) { return a > b ? a : b; }
static inline DWORD MAX(DWORD a, DWORD b) { return a > b ? a : b; }
static inline SDWORD MAX(SDWORD a, SDWORD b) { return a > b ? a : b; }
static inline QWORD MIN(QWORD a, QWORD b) { return a < b ? a : b; }
static inline DWORD MIN(DWORD a, DWORD b) { return a < b ? a : b; }
static inline SDWORD MIN(SDWORD a, SDWORD b) { return a < b ? a : b; }

#define BYTE_BITS   (8)
#define WORD_BITS   (16)
#define DWORD_BITS  (32)
#define QWORD_BITS  (64)

using M_BOOL = bool;
#define M_TRUE (true)
#define M_FALSE (false)

static void printMatrix(DWORD **p, DWORD dwSize)
{
    printf("---\n");
    for (DWORD i = 0; i < dwSize; i++) {
        for(DWORD j = 0; j < dwSize; j++) {
            printf("%5d", p[i*dwSize + j]);
        }
        cout << endl;
    }
    printf("---\n");
}

int main()
{
    DWORD dwInput_N, dwInput_M, dwInput_Q;
    char str[200];

    gets(str);
    dwInput_N = atoi(strtok(str, " "));
    dwInput_M = atoi(strtok(NULL, " "));
    dwInput_Q = atoi(strtok(NULL, " "));

    /* input train */
    static DWORD aadwTrainMap[501][501];
    for (DWORD dwIdx = 0; dwIdx < dwInput_M; dwIdx++) {
        gets(str);
        WORD wCity_L, wCity_R;

        wCity_L = atoi(strtok(str, " "));
        wCity_R = atoi(strtok(NULL, " "));
        aadwTrainMap[wCity_L][wCity_R]++;
    }

    /* calc camsum(Row, Col) */
    for (DWORD dwRow = 1; dwRow <= dwInput_N; dwRow++) {
        DWORD dwSum = 0;
        for (DWORD dwCol = 1; dwCol <= dwInput_N; dwCol++) {
            dwSum += aadwTrainMap[dwRow][dwCol];
            aadwTrainMap[dwRow][dwCol] = dwSum + aadwTrainMap[dwRow-1][dwCol];
        }
    }

    /* input question */
    for (DWORD dwIdx = 0; dwIdx < dwInput_Q; dwIdx++) {
        DWORD dwAnswer;
        gets(str);
        WORD wBegin = atoi(strtok(str, " "));
        WORD wEnd   = atoi(strtok(NULL, " "));

        dwAnswer= (aadwTrainMap[wEnd][wEnd]
                    - aadwTrainMap[wBegin-1][wEnd]
                    - aadwTrainMap[wEnd][wBegin-1]
                    + aadwTrainMap[wBegin-1][wBegin-1]);
        printf("%d\n", dwAnswer);
    }

    return 0;

}



Compiler output:
a.cc: In function 'int main()':
a.cc:54:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
   54 |     gets(str);
      |     ^~~~
      |     getw
Language: C++

#include <iostream>
#include <stdlib.h>
#include <string.h>
#include <math.h>
using namespace std;

using QWORD = unsigned long long;
using SQWORD = long long;
using DWORD = unsigned int;
using SDWORD = int;
using WORD = unsigned short;
using SWORD = short;
using DOUBLE = double;
using FLOAT = float;

#define MIN_SDWORD (-2147483648)
#define MAX_SDWORD (2147483647)
#define ArrayLength(a)  (sizeof(a) / sizeof(a[0]))

static inline QWORD MAX(QWORD a, QWORD b) { return a > b ? a : b; }
static inline DWORD MAX(DWORD a, DWORD b) { return a > b ? a : b; }
static inline SDWORD MAX(SDWORD a, SDWORD b) { return a > b ? a : b; }
static inline QWORD MIN(QWORD a, QWORD b) { return a < b ? a : b; }
static inline DWORD MIN(DWORD a, DWORD b) { return a < b ? a : b; }
static inline SDWORD MIN(SDWORD a, SDWORD b) { return a < b ? a : b; }

#define BYTE_BITS   (8)
#define WORD_BITS   (16)
#define DWORD_BITS  (32)
#define QWORD_BITS  (64)

using M_BOOL = bool;
#define M_TRUE (true)
#define M_FALSE (false)

static void printMatrix(DWORD **p, DWORD dwSize)
{
    printf("---\n");
    for (DWORD i = 0; i < dwSize; i++) {
        for(DWORD j = 0; j < dwSize; j++) {
            printf("%5d", p[i*dwSize + j]);
        }
        cout << endl;
    }
    printf("---\n");
}

int main()
{
    DWORD dwInput_N, dwInput_M, dwInput_Q;
    char str[200];

    cin.getline(str, sizeof(str));
    dwInput_N = atoi(strtok(str, " "));
    dwInput_M = atoi(strtok(NULL, " "));
    dwInput_Q = atoi(strtok(NULL, " "));

    /* input train */
    static DWORD aadwTrainMap[501][501];
    for (DWORD dwIdx = 0; dwIdx < dwInput_M; dwIdx++) {
        cin.getline(str, sizeof(str));
        WORD wCity_L, wCity_R;

        wCity_L = atoi(strtok(str, " "));
        wCity_R = atoi(strtok(NULL, " "));
        aadwTrainMap[wCity_L][wCity_R]++;
    }

    /* calc camsum(Row, Col) */
    for (DWORD dwRow = 1; dwRow <= dwInput_N; dwRow++) {
        DWORD dwSum = 0;
        for (DWORD dwCol = 1; dwCol <= dwInput_N; dwCol++) {
            dwSum += aadwTrainMap[dwRow][dwCol];
            aadwTrainMap[dwRow][dwCol] = dwSum + aadwTrainMap[dwRow-1][dwCol];
        }
    }

    /* input question */
    for (DWORD dwIdx = 0; dwIdx < dwInput_Q; dwIdx++) {
        DWORD dwAnswer;
        gets(str);
        WORD wBegin = atoi(strtok(str, " "));
        WORD wEnd   = atoi(strtok(NULL, " "));

        dwAnswer= (aadwTrainMap[wEnd][wEnd]
                    - aadwTrainMap[wBegin-1][wEnd]
                    - aadwTrainMap[wEnd][wBegin-1]
                    + aadwTrainMap[wBegin-1][wBegin-1]);
        printf("%d\n", dwAnswer);
    }

    return 0;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:81:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
   81 |         gets(str);
      |         ^~~~
      |         getw
Language: C++

#include <iostream>
#include <stdlib.h>
#include <string.h>
#include <math.h>
using namespace std;

using QWORD = unsigned long long;
using SQWORD = long long;
using DWORD = unsigned int;
using SDWORD = int;
using WORD = unsigned short;
using SWORD = short;
using DOUBLE = double;
using FLOAT = float;

#define MIN_SDWORD (-2147483648)
#define MAX_SDWORD (2147483647)
#define ArrayLength(a)  (sizeof(a) / sizeof(a[0]))

static inline QWORD MAX(QWORD a, QWORD b) { return a > b ? a : b; }
static inline DWORD MAX(DWORD a, DWORD b) { return a > b ? a : b; }
static inline SDWORD MAX(SDWORD a, SDWORD b) { return a > b ? a : b; }
static inline QWORD MIN(QWORD a, QWORD b) { return a < b ? a : b; }
static inline DWORD MIN(DWORD a, DWORD b) { return a < b ? a : b; }
static inline SDWORD MIN(SDWORD a, SDWORD b) { return a < b ? a : b; }

#define BYTE_BITS   (8)
#define WORD_BITS   (16)
#define DWORD_BITS  (32)
#define QWORD_BITS  (64)

using M_BOOL = bool;
#define M_TRUE (true)
#define M_FALSE (false)

static void printMatrix(DWORD **p, DWORD dwSize)
{
    printf("---\n");
    for (DWORD i = 0; i < dwSize; i++) {
        for(DWORD j = 0; j < dwSize; j++) {
            printf("%5d", p[i*dwSize + j]);
        }
        cout << endl;
    }
    printf("---\n");
}

int main()
{
    DWORD dwInput_N, dwInput_M, dwInput_Q;
    char str[6000];

    cin.getline(str, sizeof(str));
    dwInput_N = atoi(strtok(str, " "));
    dwInput_M = atoi(strtok(NULL, " "));
    dwInput_Q = atoi(strtok(NULL, " "));

    /* input train */
    static DWORD aadwTrainMap[dwInput_N+1][dwInput_N+1];
    for (DWORD dwIdx = 0; dwIdx < dwInput_M; dwIdx++) {
        cin.getline(str, sizeof(str));
        WORD wCity_L, wCity_R;

        wCity_L = atoi(strtok(str, " "));
        wCity_R = atoi(strtok(NULL, " "));
        aadwTrainMap[wCity_L][wCity_R]++;
    }

    /* calc camsum(Row) */
    for (DWORD dwRow = 0; dwRow <= dwInput_N; dwRow++) {
        DWORD dwSum = 0;
        for (DWORD dwCol = 0; dwCol <= dwInput_N; dwCol++) {
            dwSum += aadwTrainMap[dwRow][dwCol];
            aadwTrainMap[dwRow][dwCol] = dwSum;
        }
    }

    /* calc camsum(col) */
    for (DWORD dwCol = 0; dwCol <= dwInput_N; dwCol++) {
        DWORD dwSum = 0;
        for (DWORD dwRow = 0; dwRow <= dwInput_N; dwRow++) {
            dwSum += aadwTrainMap[dwRow][dwCol];
            aadwTrainMap[dwRow][dwCol] = dwSum;
        }
    }

    /* input question */
    for (DWORD dwIdx = 0; dwIdx < dwInput_Q; dwIdx++) {
        DWORD dwAnswer;
        cin.getline(str, sizeof(str));
        WORD wBegin = atoi(strtok(str, " "));
        WORD wEnd   = atoi(strtok(NULL, " "));

        dwAnswer= (aadwTrainMap[wEnd][wEnd]
                    - aadwTrainMap[wBegin-1][wEnd]
                    - aadwTrainMap[wEnd][wBegin-1]
                    + aadwTrainMap[wBegin-1][wBegin-1]);
        printf("%d\n", dwAnswer);
    }

    return 0;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:59:18: error: storage size of 'aadwTrainMap' isn't constant
   59 |     static DWORD aadwTrainMap[dwInput_N+1][dwInput_N+1];
      |                  ^~~~~~~~~~~~
Language: C++

#include <iostream>
using namespace std;
 
int N, M, Q, p[509][509];
int main() {
	cin >> N >> M >> Q;
	for (int i = 1; i <= M; i++) { int L, R; cin >> L >> R; p[L][R]++; }
	for (int i = 1; i <= N; i++) { for (int j = 1; j <= N; j++) p[i][j] += p[i][j - 1]; }
	for (int i = 1; i <= N; i++) { for (int j = 1; j <= N; j++) p[i][j] += p[i - 1][j]; }
 
	for (int i = 1; i <= Q; i++) {
		int L, R; cin >> L >> R;
		cout << p[R][R] + p[L - 1][L - 1] - p[L - 1][R] - p[R][L - 1] << endl;
	}
	return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:15:18: error: expected '}' at end of input
   15 |         return 0;
      |                  ^
a.cc:5:12: note: to match this '{'
    5 | int main() {
      |            ^
Language: C++

#include <stdio.h>

int main(){
  	int i,j;
  	int n,m,q;
  	int p,q;
  	int **LR;
  	int acc;
  	
  	cin>>n>>m>>q;
  	LR=new int*[N];
  	for (i=1;i<=N;i++){
    	LR[i]=new int[N-i]();
  	}
  
  	for (i=0; i<M; i++){
  		cin>>p>>q;s
    	LR[p-1][q-p] += 1;
  	}

  	for (i=N-1;i>=1;i--){
    	acc=0;
    	for (j=1;j<=N-i;j++){
      		acc+=LR[i][j];
      		LR[i][j]=acc+LR[i+1][j-1];
    	}
  	}
  
  	for (i=1;i<=q;i++){
  		cin>>p>>q;
    	cout<<LR[p-1][q-p]<<endl;
  	}
  	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:15: error: redeclaration of 'int q'
    6 |         int p,q;
      |               ^
a.cc:5:17: note: 'int q' previously declared here
    5 |         int n,m,q;
      |                 ^
a.cc:10:9: error: 'cin' was not declared in this scope
   10 |         cin>>n>>m>>q;
      |         ^~~
a.cc:11:21: error: 'N' was not declared in this scope
   11 |         LR=new int*[N];
      |                     ^
a.cc:16:21: error: 'M' was not declared in this scope
   16 |         for (i=0; i<M; i++){
      |                     ^
a.cc:17:27: error: 's' was not declared in this scope
   17 |                 cin>>p>>q;s
      |                           ^
a.cc:31:9: error: 'cout' was not declared in this scope
   31 |         cout<<LR[p-1][q-p]<<endl;
      |         ^~~~
a.cc:31:29: error: 'endl' was not declared in this scope
   31 |         cout<<LR[p-1][q-p]<<endl;
      |                             ^~~~
Language: C++

#include <cstdio>
#include <iostream>
using namespace std;

const int MAXM = 200000;
const int MAXQ = 100000;

int N, M, Q;
int L[MAXM], R[MAXM];
int p[MAXQ], q[MAXQ];
pair<int,int> LR[MAXM], pq[MAXQ];

int main()
{
  int pp, qq;
  int l, r;
  scanf("%d %d %d", &N, &M, &Q);
  for (int i=0; i<M; i++)
  {
    scanf("%d %d", &l, &r);
    LR[i] = make_pair(l, r);
  }
  for (int i=0; i<Q; i++)
  {
    scanf("%d %d", &pp, &qq);
    p[i]=pp;
    q[i]=qq;
    pq[i] = make_pair(pp, qq);
  }
  sort(LR, LR + M);
  for (int i=0; i<Q; i++)
  {
    int ans = 0;
    int x = 0;
    pp = pq[i].first;
    qq = pq[i].second;
    while (LR[x].first < pp) x++;
    while(pp <= LR[x].first && LR[x].first <= qq)
    {
      //printf("%d %d\n", LR[x].first, LR[x].second);
      if (LR[x].second <= qq)
      {
        ans++;
        //printf("%d %d\n", LR[x].first, LR[x].second);
      }
      x++;
    }
    printf("%d\n", ans);
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   30 |   sort(LR, LR + M);
      |   ^~~~
      |   short
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define [i].first 11
#define [i].second 22
#define pair<ll,ll> pr
int main(){
    ll a,b,c;
    cin>>a>>b>>c;
    ll x[a][a]={};
    pr y[b],pr z[c];
    for(int i=0;i<b;i++){
        cin>>y11>>y22;
        x[y11-1][y22-1]++;
    }
    for(int i=0;i<a;i++){
        for(int j=1;j<a;j++){
            x[i][j]+=x[i][j-1];
        }
    }
    for(int i=1;i<a;i++){
        for(int j=0;j<=i;j++){
            x[i][j]+=x[i-1][j];
        }
    }
    for(int i=0;i<c;i++){
        cin>>z11>>z22;
        z11--;
        z22--;
        if(z11) cout<<x[z22][z22]-x[z11-1][z22]-x[z22][z11-1]+x[z11-1][z22]<<endl;
        else cout<<x[z22][z22]<<endl;
    }
    return 0;
}


Compiler output:
a.cc:4:9: error: macro names must be identifiers
    4 | #define [i].first 11
      |         ^
a.cc:5:9: error: macro names must be identifiers
    5 | #define [i].second 22
      |         ^
a.cc:6:9: warning: ISO C++11 requires whitespace after the macro name
    6 | #define pair<ll,ll> pr
      |         ^~~~
a.cc: In function 'int main()':
a.cc:11:5: error: 'pr' was not declared in this scope
   11 |     pr y[b],pr z[c];
      |     ^~
a.cc:13:14: error: 'y11' was not declared in this scope; did you mean 'y1l'?
   13 |         cin>>y11>>y22;
      |              ^~~
      |              y1l
a.cc:13:19: error: 'y22' was not declared in this scope
   13 |         cin>>y11>>y22;
      |                   ^~~
a.cc:27:14: error: 'z11' was not declared in this scope
   27 |         cin>>z11>>z22;
      |              ^~~
a.cc:27:19: error: 'z22' was not declared in this scope
   27 |         cin>>z11>>z22;
      |                   ^~~
Language: C++

#include<iostream>
using namespace std;

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  
  int N,M,Q;
  cin >> N >> M >> Q;
  int L[M], R[M], p[Q], q[Q];
  for(int i = 0;i<M;i++) cin >> L[i] >> R[i];
  for(int i = 0;i<Q;i++) cin >> p[i] >> q[i];

  int c[501][501] = {0};
  for(int i = 0;i<M;i++){
    c[L[i]][R[i]]++;
  }
  for(i=1;i<N;i++){
    for(j=1;j<N;j++){
      c[i][j] = c[i-1][j] + c[i][j-1] - c[i-1][j-1];
    }
  }
  for(i=0;i<Q;i++){
    int pi = p[i], qi = q[i];
    cout < c[pi][qi] - c[pi-1][qi] - c[pi][qi-1] +c[pi-1][qi-1]
  }
}



Compiler output:
a.cc: In function 'int main()':
a.cc:18:7: error: 'i' was not declared in this scope
   18 |   for(i=1;i<N;i++){
      |       ^
a.cc:19:9: error: 'j' was not declared in this scope
   19 |     for(j=1;j<N;j++){
      |         ^
a.cc:23:7: error: 'i' was not declared in this scope
   23 |   for(i=0;i<Q;i++){
      |       ^
a.cc:25:18: error: 'qi' was not declared in this scope; did you mean 'pi'?
   25 |     cout < c[pi][qi] - c[pi-1][qi] - c[pi][qi-1] +c[pi-1][qi-1]
      |                  ^~
      |                  pi
Language: C++

import numpy as np
n, m, q = input().split()
n, m, q = int(n), int(m), int(q)
s = np.zeros((501, 501))
 
for _ in range(m):
    l, r = input().split()
    l, r = int(l), int(r)
    s[l, r] += 1
    
"""
     1 2 3
    --------
1 | 1 2 3
2 | 1 0 1
"""
    
for i in range(1, n+1):
    for j in range(1, n+1):
        s[i, j] += s[i, j-1]
        
"""
     1 2 3
    --------
1 | 1 3 6
2 | 1 1 2
"""
        
for j in range(1, n+1):
    for i in range(1, n+1):
        s[i, j] += s[i-1, j]
        
"""
     1 2 3
    --------
1 | 1 3 6
2 | 2 4 8
"""
 
for _ in range(q):
    l, r = input().split()
    l, r = int(l), int(r)
    print(int(s[r, r] - s[r, l-1] - s[l-1, r] + s[l-1, l-1]))

Compiler output:
a.cc:11:3: warning: missing terminating " character
   11 | """
      |   ^
a.cc:11:3: error: missing terminating " character
a.cc:16:3: warning: missing terminating " character
   16 | """
      |   ^
a.cc:16:3: error: missing terminating " character
a.cc:22:3: warning: missing terminating " character
   22 | """
      |   ^
a.cc:22:3: error: missing terminating " character
a.cc:27:3: warning: missing terminating " character
   27 | """
      |   ^
a.cc:27:3: error: missing terminating " character
a.cc:33:3: warning: missing terminating " character
   33 | """
      |   ^
a.cc:33:3: error: missing terminating " character
a.cc:38:3: warning: missing terminating " character
   38 | """
      |   ^
a.cc:38:3: error: missing terminating " character
a.cc:1:1: error: 'import' does not name a type
    1 | import numpy as np
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

#include <bits/stdc++.h>
int g[500][500];
using namespace std;

int main(){
  int N,M,Q;
  cin>>N>>M>>Q;
  int l,r;
  for(int i=0;i<500;i++)for(int j=0;j<500;j++)g[i][j]=0;
  for(int i=0;i<M;i++){
    cin>>l>>r;
    l--;r--;
    g[l][r]++;
  }
  for(int i=499;i>=0;i--)for(int j=1;j<500;j++)g[i][j]+=g[i][j-1];
  for(int j=0;j<500;j++)for(int i=498;i>=0;i--)g[i][j]+=g[i+1][j]
  std::vector<int> p(Q),q(Q);
  for(int i=0;i<Q;i++){
    cin>>p[i]>>q[i];
    p[i]--;q[i]--;
  }
  for(int i=0;i<Q;i++){
    cout<<g[p[i]][q[i]]<<endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:66: error: expected ';' before 'std'
   16 |   for(int j=0;j<500;j++)for(int i=498;i>=0;i--)g[i][j]+=g[i+1][j]
      |                                                                  ^
      |                                                                  ;
   17 |   std::vector<int> p(Q),q(Q);
      |   ~~~                                                             
a.cc:19:10: error: 'p' was not declared in this scope
   19 |     cin>>p[i]>>q[i];
      |          ^
a.cc:19:16: error: 'q' was not declared in this scope
   19 |     cin>>p[i]>>q[i];
      |                ^
a.cc:23:13: error: 'p' was not declared in this scope
   23 |     cout<<g[p[i]][q[i]]<<endl;
      |             ^
a.cc:23:19: error: 'q' was not declared in this scope
   23 |     cout<<g[p[i]][q[i]]<<endl;
      |                   ^
Language: C

#include<stdio.h>
int main()
{
	int M,Q,i,j;
	int N,L,R,p,q,count[501][501],l,r,ans[100001];
	scanf("%d %d %d\n",&N,&M,&Q);
	for(l=0;l<=N;l++){
		for(r=l;r<=N;r++){
			count[l][r]=0;
		}
	}
	for(j=1;j<=M;j++){
		scanf("%d %d\n",&L,&R);
		count[L][R]++;
	}
	int loop=1;
	for(j=1;j<=N;j++){
		for(i=loop;i>0;i--){
			count[i][j]=count[i][j]+count[i][j-1]+count[i+1][j]-count[i+1][j-1];
		}
		loop++
	}
	for(i=1;i<=Q;i++){
		scanf("%d %d\n",&p,&q);
		ans[i]=count[p][q];
	}
	for(i=1;i<=Q;i++){
		printf("%d\n",ans[i]);
	}
	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:21:23: error: expected ';' before '}' token
   21 |                 loop++
      |                       ^
      |                       ;
   22 |         }
      |         ~
Language: C++

#include <iostream>

using namespace std;

int main() {
  int N, M, Q;
  cin >> N >> M >> Q;
  int range_sum[N][N];
  memset(range_sum, 0, sizeof(range_sum));
  for (int i = 0; i < M; i++) {
    int l, r;
    cin >> l >> r;
    l--, r--;
    range_sum[l][r] += 1;
  }

  for (int i = 0; i < N; i++) {
    int sum = 0;
    for (int j = 0; j < N; j++) {
      sum += range_sum[i][j];
      range_sum[i][j] = sum;
    }
  }

  for (int i = 0; i < Q; i++) {
    int p, q;
    cin >> p >> q;
    p--, q--;
    int sum = 0;
    for (int j = p; j <= q; j++) {
      sum += range_sum[j][q];
    }
    cout << sum << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: 'memset' was not declared in this scope
    9 |   memset(range_sum, 0, sizeof(range_sum));
      |   ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 |
Language: C++

#include <stdio.h>
#include <bits/stdc++.h>

using namespace std;
using ll=long long;
using ld=long double;
using P=pair<ll,ll>;
#define FOR(i,n,m) for(ll i=n; i<(ll)m;i++)
#define FORr(i,n,m) for(ll i=n; i>(ll)m; i--)
#define FORm(i,m) for(auto i=m.begin();i!=m.end();i++)
#define cinv(v,n,m) FOR(i,n,m) cin>>v.at(i)
#define coutv(v,n,m) FOR(i,n,m) cout<<v.at(i) <<" "
#define cout(n) cout<<fixed<<setprecision(n)

template <class T>
std::vector<std::vector<T>> Imos2D(const std::vector<std::vector<T>>& a) {
    int h = a.size(), w = a[0].size();
    std::vector<std::vector<T>> s(h + 1, std::vector<T>(w + 1, 0));
    FOR(i,0, h) FOR(j,0, w) s[i + 1][j + 1] = a[i][j];
    FOR(i, h + 1) FOR(j,0, w) s[i][j + 1] += s[i][j];
    FOR(i,0, h) FOR(j,0, w + 1) s[i + 1][j] += s[i][j];
    return s;
}

template <class T>
int sum(const std::vector<std::vector<T>>& s, int i, int j, int h, int w) {
    return s[i + h][j + w] - s[i][j + w] + s[i][j] - s[i + h][j];
}


int main(){
  ll N,M,Q;
  cin>>N>>M>>Q;
  vector<vector<ll>> v = vector<vector<ll>> (N+1,vector<ll>(N+1,0));
  ll a,b;
  FOR(i,0,M){
    cin>>a>>b;
    v[a][b]++;
  }

  FOR(i,0,N){
    FOR(j,0,N+1){
      v[i+1][j] += v[i][j];
    }
  }
  FOR(i,0,N+1){
    FOR(j,0,N){
      v[i][j+1] += v[i][j];
    }
  }


  FOR(i,0,Q){
    cin>>a>>b;
    cout<<v[b][b]-v[a-1][b]-v[b][a-1]+v[a-1][a-1]<<endl;
  }


}


Compiler output:
a.cc:20:17: error: macro "FOR" requires 3 arguments, but only 2 given
   20 |     FOR(i, h + 1) FOR(j,0, w) s[i][j + 1] += s[i][j];
      |                 ^
a.cc:8:9: note: macro "FOR" defined here
    8 | #define FOR(i,n,m) for(ll i=n; i<(ll)m;i++)
      |         ^~~
a.cc: In function 'std::vector<std::vector<_Tp> > Imos2D(const std::vector<std::vector<_Tp> >&)':
a.cc:20:5: error: 'FOR' was not declared in this scope
   20 |     FOR(i, h + 1) FOR(j,0, w) s[i][j + 1] += s[i][j];
      |     ^~~
a.cc:20:23: error: 'j' was not declared in this scope
   20 |     FOR(i, h + 1) FOR(j,0, w) s[i][j + 1] += s[i][j];
      |                       ^
a.cc:8:32: note: in definition of macro 'FOR'
    8 | #define FOR(i,n,m) for(ll i=n; i<(ll)m;i++)
      |                                ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
long long n,m,K;
int main(){
  scanf("%d %d %d",&n,&m.&K);
  long long l[m],r[m],p[K],q[K],imos[n][n+1]={},ans=0;
  for(int i=0;i<m;i++){
    scanf("%d %d",&l[i],&r[i]);
    imos[l[i]-1][l[i]-1]++;
    imos[l[i]-1][r[i]]--;
  }
  for(int i=0;i<K;i++){
    scanf("%d %d",&p[i],&q[i]);
    ans=0;
    for(int j=p[i]-1;j<q[i];j++){
      if(imos[j][j]==0){
        continue;
      }
      for(int k=j+1;k<=q[i];k++){
        if(imos[j][k]<0){
          ans-=imos[j][k];
        }
      }
    }
    printf("%d\n",ans);
  }
  return 0;
}  


Compiler output:
a.cc: In function 'int main()':
a.cc:5:26: error: expected unqualified-id before '&' token
    5 |   scanf("%d %d %d",&n,&m.&K);
      |                          ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
long long n,m,K;
int main(){
  scanf("%d %d %d",&n,&m.&K);
  long long l[m],r[m],p[K],q[K],imos[n][n+1]={},ans=0;
  for(int i=0;i<m;i++){
    scanf("%d %d",&l[i],&r[i]);
    imos[l[i]-1][l[i]-1]++;
    imos[l[i]-1][r[i]]--;
  }
  for(int i=0;i<K;i++){
    scanf("%d %d",&p[i],q[i]);
    ans=0;
    for(int j=p[i]-1;j<q[i];j++){
      if(imos[j][j]==0){
        continue;
      }
      for(int k=j+1;k<=q[i];k++){
        if(imos[j][k]<0){
          ans-=imos[j][k];
        }
      }
    }
    printf("%d\n",ans);
  }
  return 0;
}  


Compiler output:
a.cc: In function 'int main()':
a.cc:5:26: error: expected unqualified-id before '&' token
    5 |   scanf("%d %d %d",&n,&m.&K);
      |                          ^
Language: C++

#include<cstdio>
#icnlude<algorithm>
#include<vector>
using namespace std;	
int main()
{
	int n,m,q;
	vector<int> a[500];
	scanf("%d%d%d",&n,&m,&q);
	for(int i=0;i<m;i++){
		int l,r;
		scanf("%d%d",&(l),&(r));
		a[l].push_back(r);
	}		
 	for(int i=1;i<=500;i++){
 		sort(a[i].begin(),a[i].end());
	 }
	 for(int i=1;i<=q;i++){
	 	int ll,rr;
	 	int ans=0;
	 	scanf("%d%d",&(ll),&(rr));
	 	for(int j=ll;j<=rr;j++){
	 		ans+=upper_bound(a[j].begin(),a[j].end(),rr)-a[j].begin();	
		}
		printf("%d\n",ans);
	 }
}


Compiler output:
a.cc:2:2: error: invalid preprocessing directive #icnlude; did you mean #include?
    2 | #icnlude<algorithm>
      |  ^~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:16:17: error: 'sort' was not declared in this scope; did you mean 'short'?
   16 |                 sort(a[i].begin(),a[i].end());
      |                 ^~~~
      |                 short
a.cc:23:30: error: 'upper_bound' was not declared in this scope
   23 |                         ans+=upper_bound(a[j].begin(),a[j].end(),rr)-a[j].begin();
      |                              ^~~~~~~~~~~
Language: C++

#include<ctdio>
#icnlude<algorithm>
#include<vector>
using namespace std;	
int main()
{
	int n,m,q;
	vector<int> a[500];
	scanf("%d%d%d",&n,&m,&q);
	for(int i=0;i<m;i++){
		int l,r;
		scanf("%d%d",&(l),&(r));
		a[l].push_back(r);
	}		
 	for(int i=1;i<=500;i++){
 		sort(a[i].begin(),a[i].end());
	 }
	 for(int i=1;i<=q;i++){
	 	int ll,rr;
	 	int ans=0;
	 	scanf("%d%d",&(ll),&(rr));
	 	for(int j=ll;j<=rr;j++){
	 		ans+=upper_bound(a[j].begin(),a[j].end(),rr)-a[j].begin();	
		}
		printf("%d\n",ans);
	 }
}


Compiler output:
a.cc:1:9: fatal error: ctdio: No such file or directory
    1 | #include<ctdio>
      |         ^~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <cstring>
#include <cctype>
#include <cmath>
#include <stack>
#include <queue>
#include <vector>
#include <set>
#include <map>
#include <list>
#include <stdio.h>
#include <string.h>
#include <cstdlib>
#include <math.h>
#include <bitset>
#include <iterator>
#include <iomanip>
#include <sstream>
#define INF 2000000000
using namespace std;
int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1};
#define sym cout<<"-----------"<<endl;
#define ll long long
#define P pair<int,int>
#define mk make_pair
#define en endl
#define RE return 0
#define int ll

int sum[505][505];

signed main(){
  int n,m,q;
  cin>>n>>m>>q;
  for(int i=0; i<m; i++){
    int l,r;
    cin>>l>>r;
    sum[l][r]++;
  }
  
  for(int i=1; i<=n; i++){
    for(int j=1; j<=n; j++){
      sum[i][j]+=sum[i][j-1];
    }
  }
  
  for(int i=0; i<q; i++){
    int l,r;
    cin>>l>>r;
    int ret=0;
    for(int j=l; j<=r; j++) ret+=sum[j][r]-num[j][j-1];
    cout<<ret<<en;
  }
}




Compiler output:
a.cc: In function 'int main()':
a.cc:54:44: error: 'num' was not declared in this scope; did you mean 'sum'?
   54 |     for(int j=l; j<=r; j++) ret+=sum[j][r]-num[j][j-1];
      |                                            ^~~
      |                                            sum
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define repeat(i, n) for(int i = 0; i < (n); i++)
#define Would
#define you

int main() {
	int N, M, Q;
	int L[200000], R[200000];
	int nijigen[501][501] = {};
	scanf_s("%d%d%d", &N, &M, &Q);
	//cin >> N >> M >> Q;
	repeat(i, M) {
		scanf_s("%d%d", L + i, R + i);
		//cin >> L[i] >> R[i];
		nijigen[L[i]][R[i]] += 1;
	}
	int p[100000], q[100000];
	repeat(i, Q) {
		scanf_s("%d%d", p + i, q + i);
		//cin >> p[i] >> q[i];
	}


	int ruikei[502][502] = {};

	repeat(i, N) {
		repeat(ii, N) {
			ruikei[i + 1][ii + 1] = ruikei[i + 1][ii] + nijigen[i + 1][ii + 1];
		}
	}

	repeat(ii, N) {
		repeat(i, N) {
			ruikei[N - i][ii + 1] = ruikei[N - i + 1][ii + 1] + ruikei[N - i][ii + 1];
		}
	}

	repeat(i, Q) {
		printf("%d\n", ruikei[p[i]][q[i]]);
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   11 |         scanf_s("%d%d%d", &N, &M, &Q);
      |         ^~~~~~~
      |         scanf
Language: C

#include<stdio.h>
int main()
{
	long M,Q,i,j;
	int N,L[200001],R[200001],p,q,count[501][501],l,r,ans[100001];
	scanf("%d %ld %ld\n",&N,&M,&Q);
/*	for(i=1;i<=N;i++){
		for(j=1;j<=N;j++){
			count[i][j]=0;
		}
	}*/
	count=0;
	for(j=1;j<=M;j++){
		scanf("%d %d\n",&L[j],&R[j]);
		l = L[j];
		r = R[j];
		count[l][r]++;
	}
	for(i=1;i<=Q;i++){
		scanf("%d %d",&p,&q);
		for(l=1;l<=p;l++){
			for(r=1;q<=r;r++){
				ans[i]=ans[i]+count[l][r];
			}
		}
	}
	for(i=1;i<=Q;i++){
		printf("%d\n",ans[i]);
	}
	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:12:14: error: assignment to expression with array type
   12 |         count=0;
      |              ^
Language: C

#include<stdio.h>
int main()
{
	long M,Q,i,j;
	int N,L[200001],R[200001],p,q,count[501][501],l,r,ans[100001];
	scanf("%d %ld %ld\n",&N,&M,&Q);
/*	for(i=1;i<=N;i++){
		for(j=1;j<=N;j++){
			count[i][j]=0;
		}
	}*/
	count=0;
	for(j=1;j<=M;j++){
		scanf("%d %d\n",&L[j],&R[j]);
		l = L[j];
		r = R[j];
		count[l][r]++;
	}
	for(i=1;i<=Q;i++){
		scanf("%d %d",&p,&q)
		for(l=1;l<=p;l++){
			for(r=1;q<=r;r++){
				ans[i]=ans[i]+count[l][r];
			}
		}
	}
	for(i=1;i<=Q;i++){
		printf("%d\n",ans[i]);
	}
	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:12:14: error: assignment to expression with array type
   12 |         count=0;
      |              ^
main.c:20:37: error: expected ';' before 'for'
   20 |                 scanf("%d %d",&p,&q)
      |                                     ^
      |                                     ;
   21 |                 for(l=1;l<=p;l++){
      |                 ~~~
Language: C

#include<stdio.h>
int main()
{
	long M,Q,i,j;
	int N,L[200001],R[200001],p,q,count[501][501],l,r,ans[100001];
	scanf("%d %ld %ld\n",&N,&M,&Q);
	count[][]=0;
	for(j=1;j<=M;j++){
		scanf("%d %d\n",&L[j],&R[j]);
		l = L[j];
		r = r[j];
		count[l][r]++;
	}
	for(i=1;i<=Q;i++){
		scanf("%d %d",&p,&q)
		for(l=1;l<=p,l++){
			for(r=1;q<=r,r++){
				ans[i]=ans[i]+count[l][r];
			}
		}
	}
	for(i=1;i<=Q;i++){
		printf("%d\n",ans[i]);
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:15: error: expected expression before ']' token
    7 |         count[][]=0;
      |               ^
main.c:11:22: error: subscripted value is neither array nor pointer nor vector
   11 |                 r = r[j];
      |                      ^
main.c:15:37: error: expected ';' before 'for'
   15 |                 scanf("%d %d",&p,&q)
      |                                     ^
      |                                     ;
   16 |                 for(l=1;l<=p,l++){
      |                 ~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int n,m,q;	
const int maxn=200005;
vector<int> a[500];
int main()
{
	scanf("%d%d%d",&n,&m,&q);
	for(int i=0;i<m;i++){
		int l,r;
		scanf("%d%d",&l,&r);
		a[l].push_back(r);
	}		
 	for(int i=1;i<=500;i++){
 		sort(a[i].begin(),a[i].end());
	 }
	 for(int i=1;i<=q;i++){
	 	int l,r;
	 	int ans=0;
	 	scanf("%d%d",&l,&r);
	 	for(int j=l;j<=r;j++){
	 		ans+=upper_bound(a[j].begin(),a[j].end(),r)-a[j].begin();	
		}
		printf("%d",ans);
	 }
  return 0；
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:10: error: unable to find numeric literal operator 'operator""\U0000ff1b'
   26 |   return 0；
      |          ^~~
a.cc:26:13: error: expected ';' before '}' token
   26 |   return 0；
      |             ^
      |             ;
   27 | }
      | ~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;

ll N, M, Q;
vector<vector<ll>> LR(501, vector<ll>(501, 0));
vector<vector<ll>> v(501, vector<ll>(501, 0));

int main(void){
    
    cin >> N >> M >> Q;
    for(int i = 0; i < M; ++i){
        ll a, b; scanf("%d %d", %a, %b);
        ++LR[a][b];
    }
    
    for(int x = 1; x <= N; ++x){
        ll sum = 0;
        for(int y = 1; y <= N; ++y){
            sum += LR[x][y], v[x][y] = sum;
        }
    }
    
    for(int i = 0; i < Q; ++i){
        ll a, b; scanf("%d %d", %a, %b);
        ll sum = 0;
        for(int i = a; i <= b; ++i){
            sum += v[i][b] - v[i][a - 1];
        }
        printf("%d\n", sum);
    }
    
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:33: error: expected primary-expression before '%' token
   14 |         ll a, b; scanf("%d %d", %a, %b);
      |                                 ^
a.cc:14:37: error: expected primary-expression before '%' token
   14 |         ll a, b; scanf("%d %d", %a, %b);
      |                                     ^
a.cc:26:33: error: expected primary-expression before '%' token
   26 |         ll a, b; scanf("%d %d", %a, %b);
      |                                 ^
a.cc:26:37: error: expected primary-expression before '%' token
   26 |         ll a, b; scanf("%d %d", %a, %b);
      |                                     ^
Language: C++

using namespace std;

#define REP(i, n) for(int i = 0; i < (int)(n); i++)

int main() {

    int N, M, Q;
    scanf("%d%d%d", &N, &M, &Q);

    int A[N][N];
    REP(i, N) {
        REP(j, N) {
            A[i][j] = 0;
        }
    }

    int L, R;

    REP(i, M) {
        scanf("%d%d", &L, &R);
        REP(l, L) {
            REP(r, N-R+1) {
                A[l][R+r-1] += 1;
            }
        }
    }

    int p, q;

    REP(i, Q) {
        scanf("%d%d", &p, &q);
        printf("%d\n", A[p-1][q-1]);
    }

}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: 'scanf' was not declared in this scope
    8 |     scanf("%d%d%d", &N, &M, &Q);
      |     ^~~~~
a.cc:32:9: error: 'printf' was not declared in this scope
   32 |         printf("%d\n", A[p-1][q-1]);
      |         ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | using namespace std;
Language: C++

#include<iostream>
using namespace std;
typedef long long ll;
int n, m, q;
bitset<300000>B[600];
int main()
{
  cin>>n>>m>>q;
  for(int i=1; i<=m; ++i)
  {
    int l, r;
    cin>>l>>r;
    for(int j=l; j<=r; ++j)
    {
      B[j][i]=1;
    }
  }
  for(int i=1; i<=q; ++i)
  {
    int l, r;
    cin>>l>>r;
    bitset<300000>b;
    for(int j=l; j<=r; ++j)
      b|=B[j];
    cout<<b.count()<<"\n";
  }
}


Compiler output:
a.cc:5:1: error: 'bitset' does not name a type
    5 | bitset<300000>B[600];
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:15:7: error: 'B' was not declared in this scope
   15 |       B[j][i]=1;
      |       ^
a.cc:22:5: error: 'bitset' was not declared in this scope
   22 |     bitset<300000>b;
      |     ^~~~~~
a.cc:2:1: note: 'std::bitset' is defined in header '<bitset>'; this is probably fixable by adding '#include <bitset>'
    1 | #include<iostream>
  +++ |+#include <bitset>
    2 | using namespace std;
a.cc:22:19: error: 'b' was not declared in this scope
   22 |     bitset<300000>b;
      |                   ^
a.cc:24:10: error: 'B' was not declared in this scope
   24 |       b|=B[j];
      |          ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define FOR(i,num,N) for(int(i)=(num);(i)<(N);++(i))

int main(){
    int N,M,Q,L,R
    cin>>N>>M>>Q;
    vector<vector<int>> sum(N+1,vector<int>(N+1,0));
    FOR(i,0,M){
        cin>>L>>R;
        ++sum[L][R];
    }

    FOR(i,1,N+1){
        FOR(j,1,N+1){
            sum[i][j] += sum[i-1][j];
            sum[i][j] += sum[i][j-1];
            sum[i][j] -= sum[i-1][j-1];
        }
    }

    FOR(i,0,Q){
        cin>>L>>R;
        cout<<sum[R][R] - sum[R][L-1] - sum[L][R-1] + sum[L-1][L-1]<<endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: expected initializer before 'cin'
    7 |     cin>>N>>M>>Q;
      |     ^~~
a.cc:10:17: error: 'R' was not declared in this scope
   10 |         cin>>L>>R;
      |                 ^
a.cc:23:17: error: 'R' was not declared in this scope
   23 |         cin>>L>>R;
      |                 ^
Language: C++

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

int main(){
    int N,M,Q,L,R,p,q;
    cin>>N>>M>>Q;
    vector<vector<int>> sum(N+1,vector<int>(N+1,0));
    FOR(i,0,M){
        cin>>L>>R;
        ++sum[L][R];
    }

    FOR(i,1,N+1){
        FOR(j,1,N+1){
            sum[i][j] -= sum[i-1][j-1];
            sum[i][j] += sum[i-1][j];
            sum[i][j] += sum[i][j-1];
        }
    }

    FOR(i,0,Q){
        cin>>p>>q;
        cout<<sum[q][q] - sum[p-1][q] - sum[p][q-1] + sum[p-1][p-1]<<endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'i' was not declared in this scope
    8 |     FOR(i,0,M){
      |         ^
a.cc:8:5: error: 'FOR' was not declared in this scope
    8 |     FOR(i,0,M){
      |     ^~~
Language: C++

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

#define NDEBUG
#ifdef DEBUG
#include "../cout11.h"
#undef NDEBUG
#endif
#include <cassert>

typedef long long ll;
typedef long double Double;
typedef unsigned long long ull;
typedef pair<int,int> ii;
typedef pair<ll,ll> llll;
typedef pair<double,double> dd;

typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<ii> vii;
typedef vector<vector<ii>> vvii;
typedef vector<ll> vll;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<long double> vD;

#define sz(a)  int((a).size())
#define pb  push_back
#define FOR(var,from,to) for(int var=(from);var<=(to);++var)
#define rep(var,n)  for(int var=0;var<(n);++var)
#define rep1(var,n)  for(int var=1;var<=(n);++var)
#define repC2(vari,varj,n)  for(int vari=0;vari<(n)-1;++vari)for(int varj=vari+1;varj<(n);++varj)
#define ALL(c)  (c).begin(),(c).end()
#define RALL(c)  (c).rbegin(),(c).rend()
#define tr(i,c)  for(auto i=(c).begin(); i!=(c).end(); ++i)
#define found(s,e)  ((s).find(e)!=(s).end())
#define mset(arr,val)  memset(arr,val,sizeof(arr))
#define mid(x,y) ((x)+((y)-(x))/2)
#define IN(x,a,b) ((a)<=(x)&&(x)<=(b))
#define cons make_pair



int N, M, Q;
// vi L, R;
// vvi imo;
int L[100000], R[100000];
int imo[501][501];

void prepare() {
    // imo.assign(N+1, vi(N+1, 0));
    // mset(imo, 0);

    rep(i,M){
        int from = L[i], to = R[i];
        ++imo[from][to];
    }

    for (int r=N; r>0; --r){
        rep1(c,N) {
            imo[r][c] += imo[r][c-1];
        }
        if (r < N) {
            rep(c,N+1)
                imo[r][c] += imo[r+1][c];
        }
    }
#ifdef DEBUG
    for (int r=1;r<=N;++r) {
        for (int c=1;c<=N;++c) {
            fprintf(stderr, " %2d", imo[r][c]);
        }
        fprintf(stderr, "\n");
    }
#endif
}

// int query(int p, int q) {
//     return imo[p][q];
// }

int main() {
    // cin >> N >> M >> Q;
    scanf("%d %d %d", &N, &M, &Q);
    L.resize(M); R.resize(M);
    rep(i,M) {
        // cin >> L[i] >> R[i];
        scanf("%d %d", &L[i], &R[i]);
    }

    prepare();

    rep(i,Q) {
        int p,q; // cin >> p >> q;
        scanf("%d %d", &p, &q);
        // cout << query(p,q) << endl;
        printf("%d\n", imo[p][q]);
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:85:7: error: request for member 'resize' in 'L', which is of non-class type 'int [100000]'
   85 |     L.resize(M); R.resize(M);
      |       ^~~~~~
a.cc:85:20: error: request for member 'resize' in 'R', which is of non-class type 'int [100000]'
   85 |     L.resize(M); R.resize(M);
      |                    ^~~~~~
Language: C++

#include <iostream>
#include <vector>
using namespace std;

vector<vector<int>> sum;

int buildSumTable(vector<int> L, vector<int> R){
    sum = vector<vector<int>>(N + 1, vector<int>(N + 1, 0));
    for(int i=0; i<M; i++) sum[L[i]][R[i]]++;

    for(int i=1; i<=N; i++){
        for(int j=1; j<=N; j++){
            sum[i][j] += sum[i-1][j];
            sum[i][j] += sum[i][j-1];
            sum[i][j] -= sum[i-1][j-1];
        }
    }
}

int getSumRange(int L, int R){
    int ans = sum[R][R] - sum[R][L-1] - sum[L-1][R] + sum[L-1][L-1];
    return ans;
}

int main() {
    int N, M, Q; cin >> N >> M >> Q;
    vector<int> L(M), R(M);
    for(int i=0; i<M; i++) cin >> L[i] >> R[i];
    vector<int> p(Q), q(Q);
    for(int i=0; i<Q; i++) cin >> p[i] >> q[i];

    buildSumTable(L, R);

    for(int i=0; i<Q; i++){
        int ans = getSumRange(p[i], q[i]);
        cout << ans << endl;
    }
}


Compiler output:
a.cc: In function 'int buildSumTable(std::vector<int>, std::vector<int>)':
a.cc:8:31: error: 'N' was not declared in this scope
    8 |     sum = vector<vector<int>>(N + 1, vector<int>(N + 1, 0));
      |                               ^
a.cc:9:20: error: 'M' was not declared in this scope
    9 |     for(int i=0; i<M; i++) sum[L[i]][R[i]]++;
      |                    ^
a.cc:18:1: warning: no return statement in function returning non-void [-Wreturn-type]
   18 | }
      | ^
Language: C++

#include<iostream>
#include<vector>
using namespace std;

int N, M, Q;
int main() {
	cin >> N >> M >> Q;
	vector<int> L(M);
	vector<int> R(M);
	for (int i = 0; i < M; i++)
	{
		cin >> L[i] >> R[i];
	}
	vector<int> p(Q);
	vector<int> q(Q);
	for (int i = 0; i < Q; i++)
	{
		cin >> p[i] >> q[i];
	}
	buildSumTable(L, R);

	for (int i = 0; i < Q; i++)
	{
		int ans = getSumRange(p[i], q[i]);
		cout << ans << endl;
	}
}

vector<vector<int>> sum;
int buildSumTable(vector<int> L, vector<int> R) {
	sum = vector<vector<int>>(N + 1, vector<int>(N + 1, 0));
	for (int i = 0; i < M; i++)
	{
		sum[L[i]][R[i]]++;
	}

	for (int i = 1; i <= N; i++)
	{
		for (int j = 1; j <= N; j++)
		{
			sum[i][j] += sum[i - 1][j];
			sum[i][j] += sum[i][j - 1];
			sum[i][j] -= sum[i - 1][j - 1];
		}
	}
}

int getSumRange(int L, int R) {
	int ans = sum[R][R] - sum[R][L - 1] - sum[L - 1][R] + sum[L - 1][L - 1];
	return ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:9: error: 'buildSumTable' was not declared in this scope
   20 |         buildSumTable(L, R);
      |         ^~~~~~~~~~~~~
a.cc:24:27: error: 'getSumRange' was not declared in this scope
   24 |                 int ans = getSumRange(p[i], q[i]);
      |                           ^~~~~~~~~~~
a.cc: In function 'int buildSumTable(std::vector<int>, std::vector<int>)':
a.cc:46:1: warning: no return statement in function returning non-void [-Wreturn-type]
   46 | }
      | ^
Language: C++

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <numeric>
using namespace std;
typedef long long unsigned int ll;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

int main() {

  ll N, M, Q;

  cin >> N >> M >> Q;

  ll ray[501][501] = {};

  ll a, b;
  for (int i = 0; i < M; i++){
    cin >> a >> b;
    ray[a][b]++;
  }

  for (int i = 1; i < N + 1; i++){
    for (int j = 1; j < N + 1; j++){
      ray[i][j] += ray[i][j-1];
    }
  }

  for (int i = N; i >= 1; i--){
    for (int j = 1; j < N + 1; j++){
      ray[i][j] += ray[i+1][j];
    }
  }

  vector<ll> ans;
  for (int ll = 0; i < Q; i++){
    cin >> a >> b;
    ans.push_back(ray[a][b]);
  }

  // for (int i = 1; i < N + 1; i++){
  //   for (int j = 1; j < N + 1; j++){
  //     cout <<ray[i][j];
  //   }
  //   cout << endl;
  // }


  for (ll i = 0; i < Q; i++){
    cout << ans[i] << endl;
  }


  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:51:20: error: 'i' was not declared in this scope
   51 |   for (int ll = 0; i < Q; i++){
      |                    ^
Language: C++

#include<iostream>
#include<map>
#include<vector>
#include<algorithm>
using namespace std;
vector<int> v[505];
bool can[505];
int main(){
    int n,m,q;
    scanf("%d %d %d",&n,&m,&q);
    //cin>>n>>m>>q;
    int t1,t2;
    for(int i=0;i<m;i++){
        scanf("%d %d",&t1,&t2);
        v[t1].push_back(t2);
    }
    for(map<int,vector<int> >::iterator it=v.begin();it!=v.end();++it)
        sort(it->second.begin(),it->second.end());

    for(int i=0;i<q;i++){
        scanf("%d %d",&t1,&t2);
        int sum=0;
        for(int k=t1;k<=t2;k++){
            //int l=ma[k].size();
            if(!can[k]){
                sort(v[k].begin(),v[k].end());
                can[k]=1;
            }
            vector<int>::iterator up=upper_bound (v[k].begin(), v[k].end(), t2);
            sum+=(up- v[k].begin());
        }
        printf("%d\n",sum);

    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:46: error: request for member 'begin' in 'v', which is of non-class type 'std::vector<int> [505]'
   17 |     for(map<int,vector<int> >::iterator it=v.begin();it!=v.end();++it)
      |                                              ^~~~~
a.cc:17:60: error: request for member 'end' in 'v', which is of non-class type 'std::vector<int> [505]'
   17 |     for(map<int,vector<int> >::iterator it=v.begin();it!=v.end();++it)
      |                                                            ^~~
Language: C++

#include <bits/stdc++.h>
 
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define CLR(a) memset((a), 0 ,sizeof(a))
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vi> vii;
typedef vector<string> vs;
typedef pair<int, int> pi;
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MKP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
 
const int INF = 999999;
const double EPS = 1e-10;
const double PI = acos(-1.0);
const ll MOD = 1000000007;

int dp[505][505];
int N,M,Q;

int main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);
    cin >> N >> M >> Q;
    REP(i,M){
        int l,r;
        cin >> l >> r;
        dp[l][r]++;
    }
    for(int i = N; i >= 1; i--){
        for(int j = 1; j <= n; j++){
            dp[i][j] += (dp[i+1][j] + dp[i][j - 1] - dp[i+1][j - 1]);
        }
    }

    REP(i,Q){
        int l,r;
        cin >> l >> r;
        cout << dp[l][r];
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:42:29: error: 'n' was not declared in this scope
   42 |         for(int j = 1; j <= n; j++){
      |                             ^
Language: C++

#include <bits/stdc++.h>
 
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define CLR(a) memset((a), 0 ,sizeof(a))
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vi> vii;
typedef vector<string> vs;
typedef pair<int, int> pi;
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MKP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
 
const int INF = 999999;
const double EPS = 1e-10;
const double PI = acos(-1.0);
const ll MOD = 1000000007;

int dp[505][505];
int N,M,Q;

int main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);
    cin >> N >> M >> Q;
    REP(i,M){
        int l,r;
        cin >> l >> r;
        dp[l][r]++;
    }
    for(int i = N; i >= 1; i--){
        for(int j = 1; j <= n; j++){
            dp[i][j] += (dp[i+1][j] + dp[i][j - 1] - dp[i+1][j - 1];
        }
    }

    REP(i,Q){
        int l,r;
        cin >> l >> r;
        cout << dp[l][r];
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:42:29: error: 'n' was not declared in this scope
   42 |         for(int j = 1; j <= n; j++){
      |                             ^
a.cc:43:68: error: expected ')' before ';' token
   43 |             dp[i][j] += (dp[i+1][j] + dp[i][j - 1] - dp[i+1][j - 1];
      |                         ~                                          ^
      |                                                                    )