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

#include <iostream>
using namespace std;

int main(){
  int N, P, Q;
  int C[500000];
  cin >> N >> P >> Q;
  for(int i=0;i<N;i++) cin >> C[i];
  int x[500001];
  int y[500001];
  y[0]=P*Q;
  y[1]=C[0];
  
  for(int i=1;i<N;i++){
    for(int k=0;k<500001;k++) x[k]=y[k];
    y[0]=x[0]+P*(Q+i);
    for(int j=1;j<=i;j++){
      int shokudo,jisui;
      shokudo=x[j-1]+C[i];
      jisui=x[j]+P*(Q+i-j*2);
      y[j]=max(shokudo,jisui);
    }
    y[i+1]=x[i]+C[i];
  }

  sort(y,y+(N+1));
  cout << y[N] << endl;

  return 0;
}

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

#include<cstdio>
#include<cstring>
#include<vector>
#include<queue>
#include<algorithm>
#include<cmath>
#include<climits>
#include<string>
#include<set>
#include<numeric>
#include<map>
#include<iostream>
using namespace std;
#define rep(i,n) for(int i = 0;i<((int)(n));i++)
#define reg(i,a,b) for(int i = ((int)(a));i<=((int)(b));i++)
#define irep(i,n) for(int i = ((int)(n)-1);i>=0;i--)
#define ireg(i,a,b) for(int i = ((int)(b));i>=((int)(a));i--)
typedef long long ll;
typedef pair<ll, ll> mp;
#define fir first
#define sec second
#define IINF INT_MAX
#define LINF LLONG_MAX
#define pque(type) priority_queue<type,vector<type>,greater<type> >

int main(void){
	ll DP[500000][500000]={};//i??\????????§??§,j?????????
	ll N,P,Q;
	cin>>N>>P>>Q;
	ll C[500000];
	rep(i,N)cin>>C[i];
	ll max=0;
	rep(i,N){//?????\?????????
		rep(j,N){
			DP[i][j]=max(DP[i-1][j]+C[i],DP[i-1][j-1]+(Q+(i-1)-2*j)*P);
			if(i==N-1 || max<DP[i][j])max=DP[i][j];
		}
	}
	cout<<max<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:37: error: 'max' cannot be used as a function
   35 |                         DP[i][j]=max(DP[i-1][j]+C[i],DP[i-1][j-1]+(Q+(i-1)-2*j)*P);
      |                                  ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <functional>
using namespace std;

#define rep(i,a,n) for(int (i)=(a); (i)<(n); (i)++)
#define repq(i,a,n) for(int (i)=(a); (i)<=(n); (i)++)
#define repr(i,a,n) for(int (i)=(a); (i)>=(n); (i)--)
#define int long long int

template<typename T> void chmax(T &a, T b) {a = max(a, b);}
template<typename T> void chmin(T &a, T b) {a = min(a, b);}
template<typename T> void chadd(T &a, T b) {a = a + b;}

typedef pair<int, int> pii;
typedef long long ll;

int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
constexpr ll INF = 1001001001001001LL;
constexpr ll MOD = 1000000007LL;

int N, P, Q;
int C[500010];

signed main() {
    cin >> N >> P >> Q;
    rep(i,0,N) cin >> C[i], C[i] += P*i;
    sort(C, C+N);

    int sum = accumulate(C, C+N, 0LL), ans = -INF;
    repq(i,0,N) {
        chmax(ans, sum + P*Q*i + P*i*(i-1));
        if(i < N) sum -= D[i];
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:54:26: error: 'D' was not declared in this scope
   54 |         if(i < N) sum -= D[i];
      |                          ^
Language: C++

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

#define max(a,b) ((a)>(b)?(a):(b))

typedef long long LL

int main(){
  int n,p,q;
  cin >> n >> p >> q;
  vector<int> c(n);
  for(int i=0;i<n;i++){
    cin >> c[i];
    c[i]+=i*p;
  }
  sort(c.begin(),c.end(),greater<int>());
  LL ans=(q*n+n*(n-1)/2)*p;
  LL ruiseki=0;
  for(int i=0;i<n;i++){
    ruseki+=c[i];
    ans=max(ans,ruiseki+(q*(i+1)+(n-i-2)*(n-i-1))*p-(n*(n-1)/2)*p);
  }
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc:8:1: error: expected initializer before 'int'
    8 | int main(){
      | ^~~
Language: C++

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

#define max(a,b) ((a)>(b)?(a):(b))

typedef long long LL;

int main(){
  int n,p,q;
  cin >> n >> p >> q;
  vector<int> c(n);
  for(int i=0;i<n;i++){
    cin >> c[i];
    c[i]+=i*p;
  }
  sort(c.begin(),c.end(),greater<int>());
  LL ans=(q*n+n*(n-1)/2)*p;
  LL ruiseki=0;
  for(int i=0;i<n;i++){
    ruseki+=c[i];
    ans=max(ans,ruiseki+(q*(i+1)+(n-i-2)*(n-i-1))*p-(n*(n-1)/2)*p);
  }
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:5: error: 'ruseki' was not declared in this scope; did you mean 'ruiseki'?
   20 |     ruseki+=c[i];
      |     ^~~~~~
      |     ruiseki
Language: C++

#include <bits/stdc++.h>
#define N 51
using namespace std;
int h,w,p=0;
string A,mp[N];
int dx[]={0,1,0,-1};
int dy[]={-1,0,1,0};
int x,y,dir;
void start();

void Forward(){
  int nx = x+dx[dir],ny = y+dy[dir];
  if(nx>=0&&ny>=0&&nx<w&&ny<h&&mp[ny][nx]!='#') x=nx,y=ny;
}
 
void Back(){
  int nx = x+dx[(dir+2)%4],ny = y+dy[(dir+2)%4];
  if(nx>=0&&ny>=0&&nx<w&&ny<h&&mp[ny][nx]!='#') x=nx,y=ny;
}
 
void getIdx(){
  char ch = A[p];
  int cnt=0;
  while(1){
    if(ch=='{')cnt+=(A[p]=='{')-(A[p]=='}');
    if(ch=='[')cnt+=(A[p]=='[')-(A[p]==']');
    p++;
    if(cnt==0) return;
  } 
}

bool kabe(){
  int nx = x+dx[dir],ny = y+dy[dir];
  if(nx<0||ny<0||nx>=w||ny>=h) return 1;
  return mp[ny][nx] == '#';
}
 
int getCheck(){
  char P = A[p];
  if(P=='N')return dir == 0;
  if(P=='E')return dir == 1;
  if(P=='S')return dir == 2;
  if(P=='W')return dir == 3;
  if(P=='C')return kabe();
  if(P=='T')return 1;
}

void While(){
  int sp = p;
  int f = A[++p]=='~';p+=f;
  int l = p;
  while(1){
    bool con = getCheck()+f);p++;
    if(f) con = !con;
    if(con==0) break;
    start();
    p = l;
  }
  p = sp;
  getIdx();
}
 
void If(){
  assert(A[p]=='[');
  int sp = p;
  int f = A[++p]=='~';p+=f;
  bool con = getCheck();p++;
  if(f) con = !con;
  if(con) start();
  p = sp;
  getIdx();
}
 
int ans,cnt;
void start(){
  while(1){
    if(cnt++>1e7)cout<<-1<<endl,exit(0);
    char P = A[p];
    if(P == '{') While();      
    else if(P == '[')If();
    else if(P =='^'||P=='v'){
      (P=='^')? Forward():Back(),ans++,p++;
      if(mp[y][x] == 'g')cout<<ans<<endl,exit(0);
    }
    else if(P=='<'||P=='>') dir=(P=='>')?(dir+1)%4:(dir+3)%4,ans++,p++;
    else return;
  }
}
 
int main(){
  cin>>h>>w;
  for(int i=0;i<h;i++)cin>>mp[i];
  cin>>A;

  for(int i=0;i<h;i++)
    for(int j=0;j<w;j++) if(mp[i][j] == 's')y = i,x = j;

  start();
  cout<<-1<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'void While()':
a.cc:53:28: error: expected ',' or ';' before ')' token
   53 |     bool con = getCheck()+f);p++;
      |                            ^
a.cc: In function 'int getCheck()':
a.cc:46:1: warning: control reaches end of non-void function [-Wreturn-type]
   46 | }
      | ^
Language: C++

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


int N,K;
int memo[1 << 17];
int memo2[1 << 17];
int getans(bitset<17>&bs, const vector<vector<int>>&love) {
	if (memo[bs.to_ulong()] != -1)return memo[bs.to_ulong()];
	if (bs.count() == 0) {
		return memo[bs.to_ulong()] =0;
	}
	else {
		vector<int>unused;
		for (int i = 0; i < 17; ++i) {
			if (bs[i])unused.push_back(i);
		}
		vector<int>team;
		int ans = 0;
		for (int i = 1; i < (1 << unused.size()); ++i) {
			bitset<17>team;
			int num(i);
			for (int j = 0; j < unused.size(); ++j) {
				team[j] = num % 2;
				num /= 2;
			}
			if (team[0] == 0)continue;
			int teamlove = 0;
			{
				bitset<17>lovebs;
				vector<int>as;
				for (int j = 0; j < unused.size(); ++j) {
					if (team[j]){
						lovebs[unused[j]] = true;
						as.push_back(unused[j]);
				}
				if (memo2[lovebs.to_ulong()] == -1) {
					for (int j = 0; j < as.size(); ++j) {
						for (int k = 0; k <as.size(); ++k) {
							teamlove += love[as[j]][as[k]];
						}
					}
					memo2[lovebs.to_ulong()] = teamlove;
				}
				else {
					teamlove = memo2[lovebs.to_ulong()];
				}
			}

			for (int j = 0; j < unused.size(); ++j) {
				if (team[j])bs[unused[j]] = false;
			}
			ans = max(ans, teamlove+getans(bs, love) + K);
			for (int j = 0; j < unused.size(); ++j) {
				if (team[j])bs[unused[j]] =true;
			}
		}
		return memo[bs.to_ulong()] = ans;
	}
}
int main() { 
	cin >> N >> K; K *= 2;
	for (int i = 0; i < (1 << 17); ++i) {
		memo[i] = -1;
		memo2[i] = -1;
	}
	//fill(memo, memo + sizeof(memo), -1);
	int sum = 0;
	vector<vector<int>>love(N, vector<int>(N));
	for (int i = 0; i < N; ++i) {
		for (int j = 0; j < N; ++j) {
			cin >> love[i][j];
			sum += love[i][j];
		}
	}
	
	bitset<17>bs;
	for (int i = 0; i < N; ++i)bs[i] = true;
	int ans = getans(bs, love);
	cout << (ans - sum )/2<< endl;
	return 0;
}

Compiler output:
a.cc: In function 'int getans(std::bitset<17>&, const std::vector<std::vector<int> >&)':
a.cc:61:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   61 | int main() {
      |         ^~
a.cc:61:9: note: remove parentheses to default-initialize a variable
   61 | int main() {
      |         ^~
      |         --
a.cc:61:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:61:12: error: a function-definition is not allowed here before '{' token
   61 | int main() {
      |            ^
a.cc:82:2: error: expected '}' at end of input
   82 | }
      |  ^
a.cc:8:59: note: to match this '{'
    8 | int getans(bitset<17>&bs, const vector<vector<int>>&love) {
      |                                                           ^
a.cc:82:2: warning: control reaches end of non-void function [-Wreturn-type]
   82 | }
      |  ^
Language: C++

#include <iostream>
#include <algorithm>

using namespace std;

double solve(T, D, TA, TB, DA, DB)
{
    double res = 999999999999999.99;
    
    for(int i = 0; i <= D; i += DA)
    {
        for(int j = 0; i + j <= D; j += DB)
        {
            int Acal = TA * i;
            int Bcal = TB * j;
            
            double Temperature = (1.0 * (Acal + Bcal)) / (i + j);
            
            res = min(res, abs(Temperature - T));
        }
    }
    
    return res;
}

int a, b, c, d, e, f;

int main()
{
    cin >> a >> b >> c >> d >> e >>f;
    
    printf("%.999999f\n", solve(a, b, c, d, e, f);
    
    return 0;
}

Compiler output:
a.cc:6:14: error: 'T' was not declared in this scope
    6 | double solve(T, D, TA, TB, DA, DB)
      |              ^
a.cc:6:17: error: 'D' was not declared in this scope
    6 | double solve(T, D, TA, TB, DA, DB)
      |                 ^
a.cc:6:20: error: 'TA' was not declared in this scope
    6 | double solve(T, D, TA, TB, DA, DB)
      |                    ^~
a.cc:6:24: error: 'TB' was not declared in this scope
    6 | double solve(T, D, TA, TB, DA, DB)
      |                        ^~
a.cc:6:28: error: 'DA' was not declared in this scope
    6 | double solve(T, D, TA, TB, DA, DB)
      |                            ^~
a.cc:6:32: error: 'DB' was not declared in this scope
    6 | double solve(T, D, TA, TB, DA, DB)
      |                                ^~
a.cc:6:34: error: expression list treated as compound expression in initializer [-fpermissive]
    6 | double solve(T, D, TA, TB, DA, DB)
      |                                  ^
a.cc: In function 'int main()':
a.cc:32:32: error: 'solve' cannot be used as a function
   32 |     printf("%.999999f\n", solve(a, b, c, d, e, f);
      |                           ~~~~~^~~~~~~~~~~~~~~~~~
Language: C++

#include <iostream>
#include <algorithm>

using namespace std;

double solve(int T, int D, int TA, int TB, int DA, int DB)
{
    double res = 999999999999999.99;
    
    for(int i = 0; i <= D; i += DA)
    {
        for(int j = 0; i + j <= D; j += DB)
        {
            int Acal = TA * i;
            int Bcal = TB * j;
            
            double Temperature = (1.0 * (Acal + Bcal)) / (i + j);
            
            res = min(res, abs(Temperature - T));
        }
    }
    
    return res;
}

int a, b, c, d, e, f;

int main()
{
    cin >> a >> b >> c >> d >> e >>f;
    
    printf("%.999999f\n", solve(a, b, c, d, e, f);
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:50: error: expected ')' before ';' token
   32 |     printf("%.999999f\n", solve(a, b, c, d, e, f);
      |           ~                                      ^
      |                                                  )
Language: C++

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

vector<pair<string, pair<string,string>>> books;

void search_books(string qname, string qauthor, string qfrom, string qto){
    for(int i=0;i<books.size();++i){
        if(books[i].first.find(qname)==string::npos&&qname.at(0)!='*') continue;
        if(books[i].second.first.find(qauthor)==string::npos&&qauthor.at(0)!='*') continue;
        if((books[i].second.second<qfrom&&qfrom.at(0)!='*') continue;
        if((books[i].second.second>qto&&qto.at(0)!='*') continue;
        cout << books[i].first << endl;
    }

    return;
}

int main() {
    for(int N;cin>>N;){
        for(int i=0;i<N;++i){
            string name,author,date;
            cin>>name>>author>>date;
            books.push_back(make_pair(name,make_pair(author,date)));
        }
        int Q;
        cin>>Q;
        for(int i=0;i<Q;++i){
            string qname,qauthor,qfrom,qto;
            cin>>qname>>qauthor>>qfrom>>qto;
            search_books(qname,qauthor,qfrom,qto);
            if(i!=Q-1) cout << endl;
        }
    }
    return 0;
}

Compiler output:
a.cc: In function 'void search_books(std::string, std::string, std::string, std::string)':
a.cc:10:60: error: expected ';' before 'continue'
   10 |         if((books[i].second.second<qfrom&&qfrom.at(0)!='*') continue;
      |                                                            ^~~~~~~~~
      |                                                            ;
a.cc:11:9: error: expected primary-expression before 'if'
   11 |         if((books[i].second.second>qto&&qto.at(0)!='*') continue;
      |         ^~
a.cc:10:70: error: expected ')' before 'if'
   10 |         if((books[i].second.second<qfrom&&qfrom.at(0)!='*') continue;
      |           ~                                                          ^
      |                                                                      )
   11 |         if((books[i].second.second>qto&&qto.at(0)!='*') continue;
      |         ~~
Language: C++

#define _USE_MATH_DEFINES
#define INF 0x3f3f3f3f
 
#include <iostream>
#include <cstdio>
#include <sstream>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>
#include <set>
#include <deque>
#include <bitset>
#include <list>
#include <cctype>
#include <utility>
   
using namespace std;
   
typedef long long ll;
typedef pair <int,int> P;
typedef pair <int,P> PP;
   
static const double EPS = 1e-8;
   
static const int tx[] = {0,1,0,-1};
static const int ty[] = {-1,0,1,0};

class Book {
private:
  string title;
  string author;
  string date;

  int date2day(string date){
    vector<string> elements;
    string tmp = "";
    for(int i = 0; i < date.size(); i++){
      if(date[i] == '/'){
        elements.push_back(tmp);
        tmp = "";
        continue;
      }
      tmp += date[i];
    }
    elements.push_back(tmp);
    
    return 365 * (atoi(elements[0].c_str()) - 1970)
      + (atoi(elements[1].c_str()) - 1) * 31
      + (atoi(elements[2].c_str()) - 1);
  }

public:
  Book(string title, string author, string date) {
    this->title = title;
    this->author = author;
    this->date = date;
  }

  bool match_title(string query){
    if(query == "*") return true;
    for(int i = 0; i + query.size() <= title.size(); i++){
      if(title.substr(i,query.size()) == query) return true;
    }
    return false;
  }

  bool match_author(string query){
    if(query == "*") return true;
    for(int i = 0; i + query.size() <= author.size(); i++){
      if(author.substr(i,query.size()) == query) return true;
    }
    return false;
  }

  bool match_date(string from,string to) {
    int my_sec = date2sec(date);
    if(from != "*" && my_sec < date2sec(from)) return false;
    if(to != "*" && my_sec > date2sec(to)) return false;
    return true;
  }

  string get_title() const {
    return title;
  }
};

int main(){
  int num_of_books;
  int num_of_queries;
  while(~scanf("%d",&num_of_books)){
    vector<Book> books;
    for(int book_i = 0; book_i < num_of_books; book_i++){
      string title,author,date;
      cin >> title >> author >> date;
      books.push_back(Book(title,author,date));
    }
    scanf("%d",&num_of_queries);
    for(int query_i = 0; query_i < num_of_queries; query_i++){
      string title,author,from,to;
      cin >> title >> author >> from >> to;
      for(int book_i = 0; book_i < num_of_books; book_i++){
        if(books[book_i].match_title(title)
           && books[book_i].match_author(author)
           && books[book_i].match_date(from,to)){
          cout << books[book_i].get_title() << endl;
        }
      }
      if(query_i != num_of_queries -1){
        cout << endl;
      }
    }
  }
}

Compiler output:
a.cc: In member function 'bool Book::match_date(std::string, std::string)':
a.cc:82:18: error: 'date2sec' was not declared in this scope
   82 |     int my_sec = date2sec(date);
      |                  ^~~~~~~~
Language: C++

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

struct book{
  string n,a,d;

  bool match(string a, string b, string c, string d){
    if(a!="*" && n.find(a)==string::npos)return false;
    if(b!="*" && a.find(b)==string::npos)return false;
    if(c!="*" && d<c)return false;
    if(d!="*" && d<date)return false;
    return true;
  }
};

int main(){
  int n; cin >> n;
  string a,b,c,d;

  book B[100];
  for(int i=0;i<n;i++){
    cin >> a >> b >> c;
    B[i].n = a; B[i].a = b; B[i].d = c;
  }

  int q; cin >> q;
  for(int i=0;i<q;i++){
    cin >> a >> b >> c >> d;
    for(int j=0;j<n;j++){
      if(B[j].match(a,b,c,d))cout << B[j].name << endl;
    }
    if(i<q-1)cout << endl;
  }
}

Compiler output:
a.cc: In member function 'bool book::match(std::string, std::string, std::string, std::string)':
a.cc:11:20: error: 'date' was not declared in this scope
   11 |     if(d!="*" && d<date)return false;
      |                    ^~~~
a.cc: In function 'int main()':
a.cc:30:43: error: 'struct book' has no member named 'name'
   30 |       if(B[j].match(a,b,c,d))cout << B[j].name << endl;
      |                                           ^~~~
Language: C++

#include <string>
#include <iostream>
using namespace std;
int N, Q, y, m, d, date[100]; string a, b, c, d, book[100], auth[100];
int main() {
	cin >> N;
	for(int i = 0; i < N; i++) {
		cin >> book[i] >> auth[i] >> a;
		sscanf(a.c_str(), "%d/%02d/%02d", y, m, d);
		date[i] = y * 10000 + m * 100 + d;
	}
	cin >> Q;
	for(int i = 0; i < Q; i++) {
		cin >> a >> b >> c >> d;
		if(i) cout << endl;
		if(c != "*") sscanf(c.c_str(), "%d/%02d/%02d", y, m, d);
		int d1 = y * 10000 + m * 100 + d;
		if(d != "*") sscanf(d.c_str(), "%d/%02d/%02d", y, m, d);
		int d2 = y * 10000 + m * 100 + d;
		for(int i = 0; i < N; i++) {
			bool f1 = (a == "*" || book[i].find(a) != string::npos);
			bool f2 = (b == "*" || auth[i].find(b) != string::npos);
			bool f3 = (c == "*" || date[i] >= d1);
			bool f4 = (d == "*" || date[i] <= d2);
			if(f1 && f2 && f3 && f4) cout << book[i] << endl;
		}
	}
}

Compiler output:
a.cc:4:47: error: conflicting declaration 'std::string d'
    4 | int N, Q, y, m, d, date[100]; string a, b, c, d, book[100], auth[100];
      |                                               ^
a.cc:4:17: note: previous declaration as 'int d'
    4 | int N, Q, y, m, d, date[100]; string a, b, c, d, book[100], auth[100];
      |                 ^
a.cc: In function 'int main()':
a.cc:18:22: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   18 |                 if(d != "*") sscanf(d.c_str(), "%d/%02d/%02d", y, m, d);
      |                    ~~^~~~~~
a.cc:18:39: error: request for member 'c_str' in 'd', which is of non-class type 'int'
   18 |                 if(d != "*") sscanf(d.c_str(), "%d/%02d/%02d", y, m, d);
      |                                       ^~~~~
a.cc:24:38: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   24 |                         bool f4 = (d == "*" || date[i] <= d2);
      |                                    ~~^~~~~~
Language: C++

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

int extgcd(int a, int b, int& x, int& y){
    int d=a;
    if(b!=0){
        d = extgcd(b,a%b,y,x);
        y-=(a/b)*x;
    }else{
        x=1;y=0;
    }
    return d;
}

int mod_inverse(int a, int m){
    int x, y;
    extgcd(a,m,x,y);
    return (m+x%m)%m;
}

pair<int, int> linear_consequense(const vector<int>& a, const vector<int>& b, const vector<int>& m){
   int x=0,M=1;

   for(int i=0;i<a.size();++i){
       if(b[i]==-1) continue;
       int B=b[i]-a[i]*x, d=__gcd(m[i],1);
       if(B%d!=0) return make_pair(0,-1);
       int t = B / d * mod_inverse(1/d, m[i]/d) % (m[i]/d);
       x = x + M * t;
       M *= m[i] / d;
   }
   return make_pair(x%M,M);
}

int main() {

    for(int n,m,d;cin>>n>>m>>d;){
        vector<int> a(m);
        for(int i=0;i<m;++i){
            cin>>a[i];
        }
        vector<int> r(m);
        vector<int> aa(m,1);
        pair<int,int> aaa;
        for(int i=0;i<d;++i){
            for(int j=0;j<m;++j){
                cin >> r[j];
            }
            aaa = linear_consequense(aa, r, a);
            int p=n/aaa.second;
            int q=n%aaa.second;
            int k=(q-aaa.first+aaa.second) % aaa.second;
            n=p*aaa.second-q-k;
            if(n<0){
                n=-1;
                break;
            }
        }
        cout << n << endl;
    }
    return 0;

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

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

int extgcd(int a, int b, int &x, int &y) {
	int d = a;
	if(b != 0) {
		d = extgcd(b, a % b, y, x);
		y -= (a / b) * x;
	} else {
		x = 1;
		y = 0;
	}
	return d;
}

int mod_inverse(int a, int m) {
	int x, y;
	extgcd(a, m, x, y);
	return (x % m + m) % m;
}

pair<int, int> linear_congruence(const vector<int> &A, const vector<int> &B, const vector<int> &M) {
	int x = 0, m = 1;

	for(unsigned i = 0; i < A.size(); ++i) {
		if(B[i] == -1) continue;

		int a = A[i] * m, b = B[i] - A[i] * x, d = __gcd(M[i], a);
		if(b % d != 0) return make_pair(0, -1);
		int t = b / d * mod_inverse(a / d, M[i] / d) % (M[i] / d);
		x = x + m * t;
		m *= M[i] / d;
	}

	return make_pair(x % m, m);
}

int main() {
	cin.tie(nullptr);
	ios::sync_with_stdio(false);

	int n, m, d;
	cin >> n >> m >> d;

	vector<int> M(m);
	for(auto &e : M) cin >> e;

	vector<int> A(m, 1);

	for(int i = 0; i < d; ++i) {
		vector<int> B(m);
		for(auto &e : B) cin >> e;

		int b, mod;
		tie(b, mod) = linear_congruence(A, B, M);

		const int p = n / mod;
		const int q = n % mod;
		const int k = (q - b + mod) % mod;

		n = p * mod + q - k;

		if(mod == -1 || n < 0) {
			n = -1;
			break;
		}
	}

	cout << n << endl;

	return EXIT_SUCCESS;
}

Compiler output:
a.cc: In function 'std::pair<int, int> linear_congruence(const std::vector<int>&, const std::vector<int>&, const std::vector<int>&)':
a.cc:30:60: error: '__gcd' was not declared in this scope
   30 |                 int a = A[i] * m, b = B[i] - A[i] * x, d = __gcd(M[i], a);
      |                                                            ^~~~~
Language: C++

#include <iostream>
using namespace std;

const int MAX_SIZE = 300;

int cost(int x, int y) {
  int sum = 0, c = 0;
  while (x || y) {
    sum += (x % 10) * (y % 10) + c;
    c = x % 10 + y % 10 + c < 10 ? 0 : 1;
    x /= 10;
    y /= 10;
  }
  return sum + c;
}

int calc(int a[], int b[][MAX_SIZE], int s[][MAX_SIZE], int N) {
  for (int i = 0; i < N; ++i) {
    s[i][i] = a[i];
  }
  for (int i = 1; i < N; ++i) {
    for (int j = 0; j < N - i; ++j) {
      s[j][j + i] = s[j][j + i - 1] + a[j + i];
      b[j][j + i] = numeric_limits<int>::max();
      for (int k = 0; k < i; ++k) {
        b[j][j + i] = min(b[j][j + i],
                          b[j][j + k] + b[j + k + 1][j + i] + cost(s[j][j + k], s[j + k + 1][j + i]));
      }
    }
  }
  return b[0][N - 1];
}

int main() {
  int N;
  int a[MAX_SIZE];
  int s[MAX_SIZE][MAX_SIZE] = {};
  int b[MAX_SIZE][MAX_SIZE] = {};
  cin >> N;
  for (int i = 0; i < N; ++i) {
    cin >> a[i];
  }
  cout << calc(a, b, s, N) << endl;
}

Compiler output:
a.cc: In function 'int calc(int*, int (*)[300], int (*)[300], int)':
a.cc:24:21: error: 'numeric_limits' was not declared in this scope
   24 |       b[j][j + i] = numeric_limits<int>::max();
      |                     ^~~~~~~~~~~~~~
a.cc:24:36: error: expected primary-expression before 'int'
   24 |       b[j][j + i] = numeric_limits<int>::max();
      |                                    ^~~
Language: Java

import java.awt.geom.Point2D;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;


public class A {
	Scanner in = new Scanner(System.in);
	public static void main(String[] args) {
		new A();
	}
	
	public A() {
		new RitProA().doIt();
	}
	
	class RitProA{
		void doIt(){
			int n = in.nextInt();
			ArrayList<Frame> list = new ArrayList<A.Frame>();
			for(int i=0;i<n;i++)list.add(new Frame(in.nextInt(),in.nextInt(), in.nextInt(), in.nextInt(), in.nextInt()));
			Collections.sort(list);
			
			double maxKyori1 = -1.000000;
			int minTime1 = Integer.MAX_VALUE/2;
			double maxKyori2 = -1.000000;
			int minTime2 = Integer.MAX_VALUE/2;
			for(int i=0;i<n-1;i++){
				Frame f1 = list.get(i);
				Frame f2 = list.get(i+1);
				Point2D p1 = new Point2D.Double(f1.x,f1.y);
				Point2D p2 = new Point2D.Double(f2.x,f2.y);
				if(f1.t!=f2.t)continue;
				if(f1.t == 0){
					if(p1.distance(p2) > maxKyori1 && f1.a != f2.a){
						maxKyori1 = p1.distance(p2)*1.000000;
						minTime1 = f2.f - f1.f;
					}else if(Math.abs(p1.distance(p2) - maxKyori1) < 0.00000000001){
						maxKyori1 = p1.distance(p2)*1.000000;
						minTime1 = f2.f - f1.f;
					}
				}else{
					if(p1.distance(p2) >= maxKyori2 && f1.a != f2.a){
						maxKyori2 = p1.distance(p2)*1.000000;
						minTime2 = f2.f - f1.f;
					}else if(Math.abs(p1.distance(p2) - maxKyori2) < 0.00000000001){
							maxKyori2 = p1.distance(p2)*1.000000;
							minTime2 = f2.f - f1.f;
					}
				}
			}
			if(maxKyori1 == -1.0){
				System.out.println("-1 -1");
			}else System.out.printf("%.5f %.5f\n",maxKyori1,minTime1/60.0);
			if(maxKyori2 == -1.0)System.out.println("-1 -1");
			else System.out.printf("%.5f %.5f\n",maxKyori2,minTime2/60.0);
		}
	}
	
	class Frame implements Comparable<Frame>{
		int a,t,x,y,f;
		public Frame(int _f,int _a,int _t,int _x,int _y){
			this.f = _f;
			this.x = _x;
			this.y = _y;
			this.a = _a;
			this.t = _t;
		}
		public int compareTo(Frame f) {
			return this.f - f.f;
		}
		
		
	}

}

Compiler output:
Main.java:7: error: class A is public, should be declared in a file named A.java
public class A {
       ^
1 error
Language: Java

import java.awt.geom.Point2D;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;


public class Main {
	Scanner in = new Scanner(System.in);
	public static void main(String[] args) {
		new A();
	}
	
	public A() {
		new RitProA().doIt();
	}
	
	class RitProA{
		void doIt(){
			int n = in.nextInt();
			ArrayList<Frame> list = new ArrayList<A.Frame>();
			for(int i=0;i<n;i++)list.add(new Frame(in.nextInt(),in.nextInt(), in.nextInt(), in.nextInt(), in.nextInt()));
			Collections.sort(list);
			
			double maxKyori1 = -1.000000;
			int minTime1 = Integer.MAX_VALUE/2;
			double maxKyori2 = -1.000000;
			int minTime2 = Integer.MAX_VALUE/2;
			for(int i=0;i<n-1;i++){
				Frame f1 = list.get(i);
				Frame f2 = list.get(i+1);
				Point2D p1 = new Point2D.Double(f1.x,f1.y);
				Point2D p2 = new Point2D.Double(f2.x,f2.y);
				if(f1.t!=f2.t)continue;
				if(f1.t == 0){
					if(p1.distance(p2) > maxKyori1 && f1.a != f2.a){
						maxKyori1 = p1.distance(p2)*1.000000;
						minTime1 = f2.f - f1.f;
					}else if(Math.abs(p1.distance(p2) - maxKyori1) < 0.00000000001){
						maxKyori1 = p1.distance(p2)*1.000000;
						minTime1 = f2.f - f1.f;
					}
				}else{
					if(p1.distance(p2) >= maxKyori2 && f1.a != f2.a){
						maxKyori2 = p1.distance(p2)*1.000000;
						minTime2 = f2.f - f1.f;
					}else if(Math.abs(p1.distance(p2) - maxKyori2) < 0.00000000001){
							maxKyori2 = p1.distance(p2)*1.000000;
							minTime2 = f2.f - f1.f;
					}
				}
			}
			if(maxKyori1 == -1.0){
				System.out.println("-1 -1");
			}else System.out.printf("%.5f %.5f\n",maxKyori1,minTime1/60.0);
			if(maxKyori2 == -1.0)System.out.println("-1 -1");
			else System.out.printf("%.5f %.5f\n",maxKyori2,minTime2/60.0);
		}
	}
	
	class Frame implements Comparable<Frame>{
		int a,t,x,y,f;
		public Frame(int _f,int _a,int _t,int _x,int _y){
			this.f = _f;
			this.x = _x;
			this.y = _y;
			this.a = _a;
			this.t = _t;
		}
		public int compareTo(Frame f) {
			return this.f - f.f;
		}
		
		
	}

}

Compiler output:
Main.java:13: error: invalid method declaration; return type required
	public A() {
	       ^
1 error
Language: Java

import java.awt.geom.Point2D;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;


public class Main {
	Scanner in = new Scanner(System.in);
	public static void main(String[] args) {
		new Main();
	}
	
	public Main() {
		new RitProA().doIt();
	}
	
	class RitProA{
		void doIt(){
			int n = in.nextInt();
			ArrayList<Frame> list = new ArrayList<A.Frame>();
			for(int i=0;i<n;i++)list.add(new Frame(in.nextInt(),in.nextInt(), in.nextInt(), in.nextInt(), in.nextInt()));
			Collections.sort(list);
			
			double maxKyori1 = -1.000000;
			int minTime1 = Integer.MAX_VALUE/2;
			double maxKyori2 = -1.000000;
			int minTime2 = Integer.MAX_VALUE/2;
			for(int i=0;i<n-1;i++){
				Frame f1 = list.get(i);
				Frame f2 = list.get(i+1);
				Point2D p1 = new Point2D.Double(f1.x,f1.y);
				Point2D p2 = new Point2D.Double(f2.x,f2.y);
				if(f1.t!=f2.t)continue;
				if(f1.t == 0){
					if(p1.distance(p2) > maxKyori1 && f1.a != f2.a){
						maxKyori1 = p1.distance(p2)*1.000000;
						minTime1 = f2.f - f1.f;
					}else if(Math.abs(p1.distance(p2) - maxKyori1) < 0.00000000001){
						maxKyori1 = p1.distance(p2)*1.000000;
						minTime1 = f2.f - f1.f;
					}
				}else{
					if(p1.distance(p2) >= maxKyori2 && f1.a != f2.a){
						maxKyori2 = p1.distance(p2)*1.000000;
						minTime2 = f2.f - f1.f;
					}else if(Math.abs(p1.distance(p2) - maxKyori2) < 0.00000000001){
							maxKyori2 = p1.distance(p2)*1.000000;
							minTime2 = f2.f - f1.f;
					}
				}
			}
			if(maxKyori1 == -1.0){
				System.out.println("-1 -1");
			}else System.out.printf("%.5f %.5f\n",maxKyori1,minTime1/60.0);
			if(maxKyori2 == -1.0)System.out.println("-1 -1");
			else System.out.printf("%.5f %.5f\n",maxKyori2,minTime2/60.0);
		}
	}
	
	class Frame implements Comparable<Frame>{
		int a,t,x,y,f;
		public Frame(int _f,int _a,int _t,int _x,int _y){
			this.f = _f;
			this.x = _x;
			this.y = _y;
			this.a = _a;
			this.t = _t;
		}
		public int compareTo(Frame f) {
			return this.f - f.f;
		}
		
		
	}

}

Compiler output:
Main.java:20: error: package A does not exist
			ArrayList<Frame> list = new ArrayList<A.Frame>();
			                                       ^
1 error
Language: C++

//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>
#include <queue>

using namespace std;

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP 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())

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);

int main(){
  cin.tie(0);
  ios_base::sync_with_stdio(false);

  int N; cin >> N;
  double dist[2] = {-1, -1};
  int time[2] = {1e9, 1e9};
  int f_, a_, t_, x_, y_;
  cin >> f_ >> a_ >> t_ >> x_ >> y_;
  REP(i,N-1){
	int f, a, t, x, y;
	cin >> f >> a >> t >> x >> y;
	if(t_ == t && a_ != a){
	  double dist_ = sqrt((x - x_)*(x-x_)+(y-y_)*(y-y_));
	  int time_ = f - f_;
	  if(dist_ > dist[t] || dist[t] == dist_ && time_ < time[t]){
		dist[t] = dist_, time[t] = time_;
	  }
	}
	f_ = f, a_ = a, t_ = t, x_ = x, y_ = y;
  }

  REP(i,2)
	if(time[i] == 1e9)
	  cout << -1 << " " << -1 << endl;
	else
	  cout << fixed << setprecision(9) << dist[i] << " " << (time[i]*1./60) << endl;
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:64:18: error: narrowing conversion of '1.0e+9' from 'double' to 'int' [-Wnarrowing]
   64 |   int time[2] = {1e9, 1e9};
      |                  ^~~
a.cc:64:23: error: narrowing conversion of '1.0e+9' from 'double' to 'int' [-Wnarrowing]
   64 |   int time[2] = {1e9, 1e9};
      |                       ^~~
Language: C++

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

typedef struct data{
  int f, p, a, t, x, y;
}data;

double Dist(int x, int y){
  return sqrt(x*x + y*y);
}

double flame(int current, int prev){
  return (double)(current - prev)/60;
}

int main(int argc, char *argv[]){
  int n;
  double T[2] = {0}, dist[2] = {0};
  cin >> n;
  data d[n];
  for (int i = 0; i < n; i++) {
    cin >> d[i].f >> d[i].a >> d[i].t >> d[i].x >> d[i].y;
  }
  for (int i = 1; i < n; i++) {
    if(d[i - 1].t != d[i].t)continue;
    if(d[i - 1].a == d[i].a)continue;
    if(dist[d[i].t] < Dist(d[i].x - d[i - 1].x, d[i].y - d[i - 1].y)){
      T[d[i].t] = flame(d[i].f, d[i - 1].f);
      dist[d[i].t] = Dist(d[i].x - d[i - 1].x, d[i].y - d[i - 1].y);
    }
  }
  for (int i = 0; i < 2; i++) {
    printf("%lf %lf\n", dist[i], T[i]);
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:21:3: error: reference to 'data' is ambiguous
   21 |   data d[n];
      |   ^~~~
In file included from /usr/include/c++/14/string:53,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
  344 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
  334 |     data(_Tp (&__array)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
  323 |     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
  312 |     data(_Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
a.cc:7:2: note:                 'typedef struct data data'
    7 | }data;
      |  ^~~~
a.cc:23:12: error: 'd' was not declared in this scope
   23 |     cin >> d[i].f >> d[i].a >> d[i].t >> d[i].x >> d[i].y;
      |            ^
a.cc:26:8: error: 'd' was not declared in this scope
   26 |     if(d[i - 1].t != d[i].t)continue;
      |        ^
a.cc:27:8: error: 'd' was not declared in this scope
   27 |     if(d[i - 1].a == d[i].a)continue;
      |        ^
a.cc:28:13: error: 'd' was not declared in this scope
   28 |     if(dist[d[i].t] < Dist(d[i].x - d[i - 1].x, d[i].y - d[i - 1].y)){
      |             ^
Language: C++

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

int main(){

  /*f=テ」ツδ陛」ツδャテ」ツδシテ」ツδ?a=ティツδ古ァツ閉ェテ・ツ渉キ t=テ」ツδ?」ツδシテ」ツδ?x=y=テ・ツコツァテヲツィツ?/

  int N,f,a,t,x,y;
  int tmp_f,tmp_a,tmp_t,tmp_x,tmp_y; //テ・ツ可催」ツ?ョテゥツ?クテヲツ可凝」ツ?ョテヲツδ?・ツ?ア
  int i,j;
  int flg_a=0,flg_b=0;
  double distance_a,time_a,distance_b,time_b;
 


  cin >> N;


  for(i = 0 ; i < N ; i++){
  
    cin >> f >> a >> t >> x >> y;
    
    if(i > 0){
      if(tmp_a!=a&&tmp_t==t&&t==0){
	flg_a=1;
	distance_a = sqrt((x-tmp_x)*(x-tmp_x)+(y-tmp_y)*(y-tmp_y));
	time_a = (double)(f - tmp_f)/60;
      }else if(tmp_a!=a&&tmp_t==t&&t==1){
	flg_b=1;
	distance_b = sqrt((x-tmp_x)*(x-tmp_x)+(y-tmp_y)*(y-tmp_y));
	time_b = (double)(f - tmp_f )/60;
      }
    }
    tmp_f = f; tmp_a = a; tmp_t = t; tmp_x = x; tmp_y = y; 
  }

  if(flg_a==0&&flg_b==1){
    cout << -1 << " " << -1 << endl;
    printf("%0.9lf %0.9lf\n",distance_b,time_b);
  }
  if(flg_a==1&&flg_b==0){
    printf("%0.9lf %0.9lf\n",distance_a,time_a);
    cout <<  -1 << " " << -1 << endl;
  }
  if(flg_a==0&&flg_b==0){
    cout <<  -1 << " " << -1 << endl;
    cout <<  -1 << " " << -1 << endl;
  }
  if(flg_a==1&&flg_b==1){
    printf("%0.10lf %0.10lf\n",distance_a,time_a);
    printf("%0.10lf %0.10lf\n",distance_b,time_b);
  }
  return 0;
}

Compiler output:
a.cc:7:3: error: unterminated comment
    7 |   /*f=テ」ツδ陛」ツδャテ」ツδシテ」ツδ?a=ティツδ古ァツ閉ェテ・ツ渉キ t=テ」ツδ?」ツδシテ」ツδ?x=y=テ・ツコツァテヲツィツ?/
      |   ^
a.cc: In function 'int main()':
a.cc:5:12: error: expected '}' at end of input
    5 | int main(){
      |           ~^
Language: C

#include <cstdio>
#include <cstdlib>

int main(void){
  int n, m;
  int *A, *B, *C;
  scanf("%d", &n);
  A = (int*)malloc(sizeof(int)*n);
  int i=0;
  for(i=0; i<n; i++){
    scanf("%d", &A[i]);
  }

  scanf("%d", &m);
  B = (int*)malloc(sizeof(int)*m);
  for(i=0; i<m; i++){
    scanf("%d", &B[i]);
  }
  C = (int*)malloc(sizeof(int)*m);
  for(i=0; i<m; i++){
    scanf("%d", &C[i]);
  }
  int j;
  for(i=0; i<m; i++){
    int s=0;
    for(j=0; j<n; j++){
      if(A[j]<=B[i]){
        s += A[j];
      }
    }
    if(s>=C[i]){
      printf("Yes\n");
    }else{
      printf("No\n");
    }
  }
  free(A);
  free(B);
  free(C);

  return 0;
}

Compiler output:
main.c:1:10: fatal error: cstdio: No such file or directory
    1 | #include <cstdio>
      |          ^~~~~~~~
compilation terminated.
Language: C++

#include <functional>
#include <algorithm>
#include <iostream>
#include <numeric>
#include <iomanip>
#include <utility>
#include <cstdlib>
#include <sstream>
#include <bitset>
#include <vector>
#include <cstdio>
#include <ctime>
#include <queue>
#include <deque>
#include <cmath>
#include <stack>
#include <list>
#include <map>
#include <set>

using namespace std;

typedef vector<int> vi;
typedef pair<int,int> pii;
typedef long long ll;

#define dump(x)  cerr << #x << " = " << (x) << endl
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(a)  (a).begin(),(a).end()
#define pb push_back

#define for_(i,a,b) for(int i=(a);i<(b);++i)
#define for_rev(i,a,b) for(int i=(a);i>=(b);--i)

int N, M, p[1000010], b[1000010];

int main() {
    memset(p, 0, sizeof(p));
    
    cin >> N;
    for_(i,0,N) {
        int a; cin >> a;
        p[a] += a;
    }
    
    for_(i,1,1000010) p[i] += p[i - 1];
    
    cin >> M;
    for_(i,0,M) cin >> b[i];
    
    for_(i,0,M) {
        int c; cin >> c;
        if (c <= p[b[i]]) cout << "Yes" << endl;
        else cout << "No" << endl;
    }
}

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

#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>

using namespace std;

int n;
int a[300000];
int m;
int b[300000],c[300000];
int total[30000];

int main(){
  cin>>n;
  for(int i=0;i<n;i++)
    cin>>a[i];
  cin>>m;
  for(int i=0;i<m;i++)
    cin>>b[i];
  for(int i=0;i<m;i++)
    cin>>c[i];

  sort(a,a+n);

  for(int i=0;i<m;i++){
    for(int j=0;j<n;j++){
      if(b[i]<a[j]){
	break;
      }else{
	total[i]+=a[j];
      }
    }
  }

  for(int i=0;i<m;i++){
    if(total[i]>=c[i])
      cout<<"Yes"<<endl;
    else
      cout<<"No"<<endl;
  }
  return 0;
  
}

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

#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <utility>
#include <string>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>

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

int main() {
	int n; cin >> n;
	int a[n];
	rep(i, n) cin >> a[i];
	int m; cin >> m;
	int b[m], c[m];
	rep(i, m) cin >> b[i];
	rep(i, m) cin >> c[i];

	int total[m] = {0};
	rep(i, n) {
		rep(j, m) {
			if (a[i] <= b[j]) total[j] += a[i];
		}
	}
	rep(i, m) {
		if (total[i] >= c[i]) {
			cout << "Yes" << endl;
		} else {
			cout << "No" << endl;
		}
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:16: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   19 |         int n; cin >> n;
      |                ^~~
      |                std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:35:25: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   35 |                         cout << "Yes" << endl;
      |                         ^~~~
      |                         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:35:42: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   35 |                         cout << "Yes" << endl;
      |                                          ^~~~
      |                                          std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:37:25: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   37 |                         cout << "No" << endl;
      |                         ^~~~
      |                         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:37:41: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   37 |                         cout << "No" << endl;
      |                                         ^~~~
      |                                         std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include <stdio.h>
#include <iostream>
#include <queue>
#include <map>
#include <string>
#include <vector>
#define PB push_back
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
using	namespace std;
int N,M,tmp;
void solve(){
  	vector <int> a;
	vector <int> b;
	vector <int> c;
	cin >> N;
	//vector <int> score;
	REP(i,N){
		cin  >> tmp;a.PB(tmp);
	}
	cin >> M;
	REP(i,M){cin>>tmp;b.PB(tmp);}
	REP(i,M){cin>>tmp;c.PB(tmp);}
	//INPUT
	
	vector <int> data(N);
	//a???????????????????°???????????????????????¶????????????????O(n logn)
	//bj????????????????????¢?????§aj????¢??????????????????????O(logn)?????????
	//?¶???????????????????????????§???????????????
	sort(a.begin(),a.end());
	data[0] = a[0];
	FOR(i,1,N){
		data[i] = data[i-1] + a[i];
	}
	REP(j,M){
		int ub = N-1;
		int lb =0;
		while(ub-lb >1){
			int mid = (ub+lb)/2;
			if( b[j]+1 <= a[mid])ub=mid;
			else lb = mid;
		}
		if(data[lb] >= c[j]){cout << "YES"<<endl;}
		else cout << "NO"<<endl;
	}



}




int main(){
	solve();

}

Compiler output:
a.cc: In function 'void solve()':
a.cc:32:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   32 |         sort(a.begin(),a.end());
      |         ^~~~
      |         short
Language: C++

#include <iostream>
#include <vector>
#include <cmath>
#include <iomanip>
#include <queue>
#include <algorithm>
#define shosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef pair<int,P> pip;
typedef vector<pip> vip;
const int inf=(1<<31)-1;
const double pi=acos(-1);

int N,M,tmp=0;
vi a,b,c;
vector<ll> dp;

int main(){
	cin>>N;
	a=vi(N);
	for(int i=0;i<N;i++) cin>>a[i];
	cin>>M;
	b=vi(M);
	c=vi(M);
	for(int i=0;i<M;i++){
		cin>>b[i];
		tmp=max(tmp,b[i]);
	}
	dp=vi(tmp+1);
	for(int i=0;i<M;i++) cin>>c[i];
	sort(a.begin(),a.end());
	for(int i=1;i<=tmp;i++){
		dp[i]=dp[i-1]+i*(upper_bound(a.begin(),a.end(),i)-lower_bound(a.begin(),a.end(),i));
	}
	for(int i=0;i<M;i++){
		if(dp[b[i]]>=c[i]) cout<<"Yes"<<endl;
		else cout<<"No"<<endl;
	}
}

Compiler output:
a.cc:17:22: warning: integer overflow in expression of type 'int' results in '2147483647' [-Woverflow]
   17 | const int inf=(1<<31)-1;
      |               ~~~~~~~^~
a.cc: In function 'int main()':
a.cc:35:20: error: no match for 'operator=' (operand types are 'std::vector<long long int>' and 'vi' {aka 'std::vector<int>'})
   35 |         dp=vi(tmp+1);
      |                    ^
In file included from /usr/include/c++/14/vector:72,
                 from a.cc:2:
/usr/include/c++/14/bits/vector.tcc:210:5: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(const std::vector<_Tp, _Alloc>&) [with _Tp = long long int; _Alloc = std::allocator<long long int>]'
  210 |     vector<_Tp, _Alloc>::
      |     ^~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/vector.tcc:211:42: note:   no known conversion for argument 1 from 'vi' {aka 'std::vector<int>'} to 'const std::vector<long long int>&'
  211 |     operator=(const vector<_Tp, _Alloc>& __x)
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
In file included from /usr/include/c++/14/vector:66:
/usr/include/c++/14/bits/stl_vector.h:766:7: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::vector<_Tp, _Alloc>&&) [with _Tp = long long int; _Alloc = std::allocator<long long int>]'
  766 |       operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:766:26: note:   no known conversion for argument 1 from 'vi' {aka 'std::vector<int>'} to 'std::vector<long long int>&&'
  766 |       operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
      |                 ~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:788:7: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::initializer_list<_Tp>) [with _Tp = long long int; _Alloc = std::allocator<long long int>]'
  788 |       operator=(initializer_list<value_type> __l)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:788:46: note:   no known conversion for argument 1 from 'vi' {aka 'std::vector<int>'} to 'std::initializer_list<long long int>'
  788 |       operator=(initializer_list<value_type> __l)
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~