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

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

int N;
map<int, vector<int>> node;
vector<pair<int, int>> dis3;
char dis[100000];

void find3(int target) {
	memset(dis, 0xFF, sizeof(dis));
	dis[target] = 0;

	for (auto itr = node[target].begin(); itr != node[target].end(); itr++) {
		if (dis[*itr] == -1) dis[*itr] = 1;
	}

	for (int i = 0; i < N; i++) {
		if (dis[i] == 1) {
			for (auto itr = node[i].begin(); itr != node[i].end(); itr++) {
				if (dis[*itr] == -1) dis[*itr] = 2;
			}
		}
	}

	for (int i = 0; i < N; i++) {
		if (dis[i] == 2) {
			for (auto itr = node[i].begin(); itr != node[i].end(); itr++) {
				if (dis[*itr] == -1) {
					if (target < *itr) dis3.push_back(make_pair(target, *itr));
				}
			}
		}
	}
}

int main() {
	cin >> N;

	int tmp1, tmp2;
	for (int i = 0; i < N - 1; i++) {
		cin >> tmp1 >> tmp2;
		tmp1--;tmp2--;
		node[tmp1].push_back(tmp2);
		node[tmp2].push_back(tmp1);
	}

	for (int i = 0; i < N - 1; i++) {
		find3(i);
	}


	cout << "-1" << endl;

	return 0;
}


Compiler output:
a.cc: In function 'void find3(int)':
a.cc:12:9: error: 'memset' was not declared in this scope
   12 |         memset(dis, 0xFF, sizeof(dis));
      |         ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include <vector>
  +++ |+#include <cstring>
    4 | using namespace std;
Language: C++

#include <bits/stdc++.h>
using namespace std;
int kyori(int i, int j, vector tree){
  for(int k=0; k<n; k++)
  vector.at(i)
  
int main(){
  int n;
  cin >> n;
  vector<vector<int>> tree(n,vector<int>()n);
  vector<vector<int>> kyori(n);
  for(int i=0; i<n-1; i++){
    int x,y;
    cin >> x >> y;
    tree.at(x-1).at(y-1)=1;
    tree.at(y-1).at(x-1)=1;
  }
 for(int i=0; i<n; i++){
   for(int j=0; j<n; j++){
     if(i==j)//あとでやる
     int x;
     
     kyori.at(i).at(j)
     
   }
   

Compiler output:
a.cc:3:25: error: missing template argument list after 'std::vector'; template placeholder not permitted in parameter
    3 | int kyori(int i, int j, vector tree){
      |                         ^~~~~~
      |                               <>
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_vector.h:428:11: note: 'template<class _Tp, class _Alloc> class std::vector' declared here
  428 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
a.cc: In function 'int kyori(...)':
a.cc:4:18: error: 'n' was not declared in this scope
    4 |   for(int k=0; k<n; k++)
      |                  ^
a.cc:5:9: error: expected unqualified-id before '.' token
    5 |   vector.at(i)
      |         ^
a.cc:25:5: error: expected '}' at end of input
   25 |    }
      |     ^
a.cc:3:37: note: to match this '{'
    3 | int kyori(int i, int j, vector tree){
      |                                     ^
a.cc:25:5: warning: no return statement in function returning non-void [-Wreturn-type]
   25 |    }
      |     ^
Language: C++


#include <iostream>
#include <algorithm>
#include <utility>
#include <vector>
#include <numeric>
#include <tuple>

template <class T, class U>
inline bool chmin(T& lhs, const U& rhs) {
  if (lhs > rhs) {
    lhs = rhs;
    return true;
  }
  return false;
}

template <class T, class U>
inline bool chmax(T& lhs, const U& rhs) {
  if (lhs < rhs) {
    lhs = rhs;
    return true;
  }
  return false;
}

// [l, r) from l to r
struct range {
  struct itr {
    int i;
    constexpr itr(int i_): i(i_) { }
    constexpr void operator ++ () { ++i; }
    constexpr int operator * () const { return i; }
    constexpr bool operator != (itr x) const { return i != x.i; }
  };
  const itr l, r;
  constexpr range(int l_, int r_): l(l_), r(std::max(l_, r_)) { }
  constexpr itr begin() const { return l; }
  constexpr itr end() const { return r; }
};

// [l, r) from r to l
struct revrange {
  struct itr {
    int i;
    constexpr itr(int i_): i(i_) { }
    constexpr void operator ++ () { --i; }
    constexpr int operator * () const { return i; }
    constexpr bool operator != (itr x) const { return i != x.i; }
  };
  const itr r, l;
  constexpr revrange(int l_, int r_): l(l_ - 1), r(std::max(l_, r_) - 1) { }
  constexpr itr begin() const { return r; }
  constexpr itr end() const { return l; }
};

template <class T>
struct fix_point: private T {
  explicit constexpr fix_point(T &&func): T(std::forward<T>(func)) { }
  template <class... Args>
  constexpr decltype(auto) operator () (Args &&... args) const {
    return T::operator()(*this, std::forward<Args>(args)...);
  }
};

template <class T>
constexpr decltype(auto) make_fix_point(T &&func) {
  return fix_point<T>{std::forward<T>(func)};
}

int main() {
  int N;
  std::cin >> N;
  std::vector<std::vector<int>> graph(N);
  for (int i: range(0, N - 1)) {
    int a, b;
    std::cin >> a >> b;
    --a; --b;
    graph[a].push_back(b);
    graph[b].push_back(a);
  }
  std::vector<int> col(N);
  make_fix_point([&](auto &&dfs, int u, int c) -> void {
    if (col[v] != 0) {
      return;
    }
    col[u] = c;
    for (int v: graph[u]) {
      dfs(v, -c);
    }
  })(0, 1);
  for (int i: range(0, N / 3)) {
    col[i] = 0;
  }
  int one = std::count(col.begin(), col.end(), 1);
  int two = N - one - N / 3;
  if (one < two) {
    for (int &x: col) {
      x = -x;
    }
  }
  std::vector<int> vec[3];
  for (int i: range(1, N + 1)) {
    vec[i % 3].push_back(i);
  }
  for (int i: range(0, N)) {
    if (col[i] == -1) {
      col[i] = 2;
    }
    std::cout << vec[col[i]].back();
    vec[col[i]].pop_back();
    std::cout << (i + 1 == N ? '\n' : ' ');
  }
  return 0;
}


Compiler output:
a.cc: In lambda function:
a.cc:84:13: error: 'v' was not declared in this scope
   84 |     if (col[v] != 0) {
      |             ^
Language: C++

// 絞り込んでmod3で考える。

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C

#include<bits/stdc++.h>
#define ll long long
#define N 222222
#define p pair <ll,ll>
#define a first
#define b second
using namespace std;
int n,t,c1=0,c2=0,ans=0;
p m[N];ll c[N],dp[40];
bool mycmp(p x,p y){
    return x.a*(y.b+1)>y.a*(x.b+1);
}
int main()
{
	scanf("%d%d",&n,&t);
	for(int i=1;i<=n;i++){
		ll x,y;
		scanf("%lld%lld",&x,&y);
		if(!x) c[++c1]=y+1;
		else m[++c2]={x,y};
	}
	sort(m+1,m+c2+1,mycmp);
	sort(c+1,c+c1+1);
	for(int i=1;i<=30;i++) 
	    dp[i]=t+1;
	dp[0]=0;
	for(int i=1;i<=c2;i++)
		for(int j=30;j>=1;j--)
			dp[j]=min(dp[j],(dp[j-1]+1)*(m[i].a+1)+m[i].b);
	for(int i=1;i<=c1;i++)
	    c[i]+=c[i-1];
	for(int i=0;i<=30;i++){
		if(dp[i]>t)
		    continue;
		int j=0;
		if(c1)
		    j=upper_bound(c+1,c+c1+1,t-dp[i])-c-1;
		ans=max(ans,i+j);
	}
	printf("%lld\n",ans);
	return 0;
}

Compiler output:
main.c:1:9: fatal error: bits/stdc++.h: No such file or directory
    1 | #include<bits/stdc++.h>
      |         ^~~~~~~~~~~~~~~
compilation terminated.
Language: C

#include<bits/stdc++.h>
#define ll long long
#define N 222222
#define p pair <ll,ll>
#define a first
#define b second
using namespace std;
int n,t,c1=0,c2=0,ans=0;
p m[N];ll c[N],dp[40];
bool mycmp(p x,p y){
    return x.a*(y.b+1)>y.a*(x.b+1);
}
int main()
{
	scanf("%d%d",&n,&t);
	for(int i=1;i<=n;i++){
		ll x,y;
		scanf("%lld%lld",&x,&y);
		if(!x) c[++c1]=y+1;
		else m[++c2]={x,y};
	}
	sort(m+1,m+c2+1,cmp);
	sort(c+1,c+c1+1);
	for(int i=1;i<=30;i++) 
	    dp[i]=t+1;
	dp[0]=0;
	for(int i=1;i<=c2;i++)
		for(int j=30;j>=1;j--)
			dp[j]=min(dp[j],(dp[j-1]+1)*(m[i].a+1)+m[i].b);
	for(int i=1;i<=c1;i++)
	    c[i]+=c[i-1];
	for(int i=0;i<=30;i++){
		if(dp[i]>t)
		    continue;
		int j=0;
		if(c1)
		    j=upper_bound(c+1,c+c1+1,t-dp[i])-c-1;
		ans=max(ans,i+j);
	}
	printf("%lld\n",ans);
	return 0;
}

Compiler output:
main.c:1:9: fatal error: bits/stdc++.h: No such file or directory
    1 | #include<bits/stdc++.h>
      |         ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
struct node
{
	ll f,s;
}a[222222];
ll c[222222],dp[36];
bool mycmp(node xx,node yy)
{
	return xx.f*(yy.s+1)>yy.f*(xx.s+1); 
}
int main()
{
	ll n,t,cnt1=0,cnt2=0,x,y,ans=0;
	cin>>n>>t;
	for(int i=1;i<=n;i++)
	{
		scanf("%lld%lld",&x,&y);
		if(x==0) cnt1++,c[cnt1]=y+1;
		else cnt2++,a[cnt2]={x,y};
	}
	sort(c+1,c+cnt1+1);
	sort(a+1,a+cnt2+1,mycmp);
	for(int i=1;i<=35;i++)
	dp[i]=t+1;
	dp[0]=0;
	for(int i=1;i<=cnt2;i++)
	{
		for(int j=30;j>0;j--)
		{
			dp[j]=min(dp[j],(dp[j-1]+1)*(a[i].f+1)+a[i].s);
		}
	}
	for(int i=1;i<=cnt1;i++) c[i]+=c[i-1];
	for(int i=0;i<=30;i++)
	{
		if(dp[i]<=t)
		{
			if(cnt1!=0)
			{
				ans=max(ans,upper_bound(c+1,c+cnt1+1,t-dp[i])-c-1+i);
			}
		}
	}
	cout<<ans; 
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:42:40: error: no matching function for call to 'max(long long int&, long int)'
   42 |                                 ans=max(ans,upper_bound(c+1,c+cnt1+1,t-dp[i])-c-1+i);
      |                                     ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:42:40: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'long int')
   42 |                                 ans=max(ans,upper_bound(c+1,c+cnt1+1,t-dp[i])-c-1+i);
      |                                     ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:42:40: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   42 |                                 ans=max(ans,upper_bound(c+1,c+cnt1+1,t-dp[i])-c-1+i);
      |                                     ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

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

const LL N=2e5+5;

LL n,T,b[N],ans,f[N],tot1,tot2;

struct node{
	LL x;
	LL y;
}a[N];

bool mycmp(node x,node y){
	return x.x*(y.y+1)>y.x*(x.y+1);
}

int main(){
	scanf("%lld%lld",&n,&T);
	for (ll i=1;i<=n;i++){
		LL x,y;
		scanf("%lld%lld",&x,&y);
		if (x==0) b[++tot2]=y+1;
		else a[++tot1]={x,y};
	}
	sort(a+1,a+tot1+1,mycmp);
	sort(b+1,b+tot2+1);
	for (int i=1;i<=35;i++) f[i]=T+1;
	for (int i=1;i<=tot1;i++)
		for (int j=35;j>=1;j--)
			f[j]=min(f[j],(f[j-1]+1)*(a[i].x+1)+a[i].y);
	for (int i=1;i<=tot2;i++) b[i]+=b[i-1];
	for (int i=0;i<=35;i++){
		if (f[i]>T) continue;
		LL x=0;
		if (tot2) x=upper_bound(b+1,b+tot2+1,T-f[i])-(b+1);
		ans=max(ans,i+x);
	}
	printf("%lld\n",ans);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:14: error: 'll' was not declared in this scope; did you mean 'LL'?
   20 |         for (ll i=1;i<=n;i++){
      |              ^~
      |              LL
a.cc:20:21: error: 'i' was not declared in this scope
   20 |         for (ll i=1;i<=n;i++){
      |                     ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
struct node{
  ll a , b;
}a0[ 201000 ];
ll a1[ 201000 ] , n , t ;
ll dp[ 201000 ] , cnt1 , cnt2 , ans;  

bool mycmp( node x , node y ){
	return y.a* x.b < x.a * y.b ;  
}
int main( ){
  scanf("%lld%lld" , &n , &t );
   for( int i = 1 ; i <= 31 ; i ++ ) dp[ i ] = t + 1;
  for( int i = 1 ; i <= n ; i ++ ){
   int a , b;
   scanf("%lld%lld" , &a , &b );
   b ++ ; b += a;
   if( a == 0 ) a1[ ++cnt1 ] = b;else 
   a0[ ++cnt2 ] = { a , b };    
  }
  sort( a0 + 1 , a0 + cnt2 + 1 , mycmp );
	sort( a1 + 1 , a1 + cnt1 + 1 );
	for( int i = 1 ; i <= cnt2 ; i ++ ){
	for( int j = 30 ; j >= 0 ; j -- ){
			if( dp[ j ] <= t ) 
			 dp[ j + 1 ] = min( dp[ j + 1 ] , dp[ j ] + a0[ i ].a * dp[ j ] + a0[ i ].b );
	}
	}
	for( int i = 1 ; i <= 30 ; i ++ ){
		if( dp[ i ] <= t ){
         int lef = t - dp[ i ] , num = i ;
			for( int j = 1 ; j <= cnt1 ; j ++ ){
			 if( lef < a1[ j ] ) break;
			 lef -= a1[ j ];
			 num ++;
		   }
		   ans = max( ans , num );
	   }
    }
	 
	printf("%lld" , ans );
}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:29: error: no matching function for call to 'max(long long int&, int&)'
   39 |                    ans = max( ans , num );
      |                          ~~~^~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:39:29: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   39 |                    ans = max( ans , num );
      |                          ~~~^~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:39:29: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   39 |                    ans = max( ans , num );
      |                          ~~~^~~~~~~~~~~~~
Language: C

#include <bits/stdc++.h>

#define IsDigit(c) ('0' <= (c) && (c) <= '9')

#define MAX 5 + 30

using namespace std;

typedef pair<int, int> Pii;

inline int read()
{
	int x = 0; bool f = true;
	char c = getchar();
	for (; ! IsDigit(c); c = getchar()) if (c == '-') f = false;
	for (; IsDigit(c); c = getchar()) x = (x << 3) + (x << 1) + (c ^ '0');
	return f ? x : -x;
}
inline void write(int x)
{
    if (x < 0)
	{
        putchar('-');
		x = -x;
	}
    if (x > 9) write(x / 10);
	putchar(x % 10 + '0');
}

int n, T, Max, Ans, f[MAX];

vector<Pii> A;
vector<int> B;

inline bool mycmp(Pii x, Pii y)
{
	return x.first * (y.second + 1) > y.first * (x.second + 1);
}

signed main()
{
	n = read(); T = read(); Max = log2(T) + 1;
	for (register int x, y, i = 1; i <= n; i++)
	{
		x = read(); y = read();
		if (x != 0) A.push_back({x, y});
		    else B.push_back(y + 1);
	}
	
	for (register int i = 1; i <= Max; i++)
		f[i] = T + 1;
	sort(A.begin(), A.end(), mycmp);
	sort(B.begin(), B.end());
	for (register int i = 1; i < B.size(); i++) B[i] += B[i - 1];	
	
	f[0] = 0;
	for (register int i = 0; i < A.size(); i++)
		for (register int j = Max; j; j--)
			    f[j] = min(f[j], (f[j - 1] + 1) * (A[i].first + 1) + A[i].second);
	for (register int i = 0	; i <= Max; i++)
		if (f[i] <= T) Ans = max(Ans, i + (B.empty() ? 0 : upper_bound(B.begin(), B.end(), T - f[i]) - B.begin()));
	write(Ans);
	
	return 0;
}

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

#include <bits/stdc++.h> 
#define MX 32
using namespace std; 
typedef long long int ll ;
typedef pair <ll , ll> P;
bool comp(P p,P q) { 
return p.second*q.first<q.second*p.first ; }
ll dp[MX];
int main() {
int n,T; 
scanf("%d %d",&n,&T); 
vector <int> all ; 
vector <P> vx; 
for(int i=0;i<n; i++) {
int a,b; 
scanf("%d %d",&a,&b); 
b++;
b+=a;
if (a==0) all.push_back(b);
else { 
vx.push_back(P(a,b)); } 
 }
 sort(vx.begin() ,vx.end() ,comp); 
for(int i=0;i<MX; i++) dp[i]=T+1;
dp[0]=0; 
for(int i=0;i<vx.size(); i++) { 
P p=vx[ i ];
 for(int j=MX−2;j>=0;j−−) { 
 if (dp[ j]>T) continue; 
dp[j+1]=min(dp[ j+1],(p.first+1)∗dp[ j]+p.second);
}
} 
sort(all.begin() ,all.end());
int ret=0; 
for(int i=0;i<MX; i++) {
  if (dp[ i]>T) continue; 
 ll zan=T−dp[ i ];
 int pos=0; 
 while(pos<all.size()&&zan>=all[pos]) { 
 zan−=all[pos];
  pos++; 
 } 
 ret=max(ret ,pos+i); 
 } 
 printf("%d\n",ret); 
return 0; 
}


Compiler output:
a.cc:28:12: error: extended character − is not valid in an identifier
   28 |  for(int j=MX−2;j>=0;j−−) {
      |            ^
a.cc:28:22: error: extended character − is not valid in an identifier
   28 |  for(int j=MX−2;j>=0;j−−) {
      |                      ^
a.cc:28:22: error: extended character − is not valid in an identifier
a.cc:30:33: error: extended character ∗ is not valid in an identifier
   30 | dp[j+1]=min(dp[ j+1],(p.first+1)∗dp[ j]+p.second);
      |                                 ^
a.cc:37:9: error: extended character − is not valid in an identifier
   37 |  ll zan=T−dp[ i ];
      |         ^
a.cc:40:2: error: extended character − is not valid in an identifier
   40 |  zan−=all[pos];
      |  ^
a.cc: In function 'int main()':
a.cc:28:12: error: 'MX\U000022122' was not declared in this scope
   28 |  for(int j=MX−2;j>=0;j−−) {
      |            ^~~~
a.cc:28:22: error: 'j\U00002212\U00002212' was not declared in this scope
   28 |  for(int j=MX−2;j>=0;j−−) {
      |                      ^~~
a.cc:30:33: error: expected ')' before '\U00002217dp'
   30 | dp[j+1]=min(dp[ j+1],(p.first+1)∗dp[ j]+p.second);
      |            ~                    ^~~
      |                                 )
a.cc:37:9: error: 'T\U00002212dp' was not declared in this scope
   37 |  ll zan=T−dp[ i ];
      |         ^~~~
a.cc:40:2: error: 'zan\U00002212' was not declared in this scope
   40 |  zan−=all[pos];
      |  ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
const ll N=2e5+5;
ll n,T,ans,b[N],tot1,tot2;
struct node
{
	ll x,y;
}a[N];
bool mycmp(node x,node y)
{
	return y.x*(x.y+1)<x.x*(y.y+1);
}
ll f[N];
int main()
{
	scanf("%lld%lld",&n,&T);
	for(ll i=1;i<=n;i++)
	{
		ll x,y;
		scanf("%lld%lld",&x,&y);
		if(x==0) b[++tot2]=y;
		else a[++tot1]={x,y};
	}
	sort(a+1,a+tot1+1,mycmp);
	sort(b+1,b+tot2+1);
	memset(f,0x3f,sizeof(f));
	f[0]=0;
	for(ll i=1;i<=tot1;i++)
		for(ll j=1;j<=min(30,i);j++)
			f[j]=min(f[j],(f[j-1]+1)*(a[i].x+1)+a[i].y);
	for(ll i=1;i<=tot2;i++) b[i]+=b[i-1];
	for(ll i=1;i<=30;i++)
	{
		ll t=f[i];
		if(t>T) continue;
		ll x=i+lower_bound(b+1,b+tot2+1,T-t)-b-1;
		ans=max(ans,x);
	}
	printf("%lld\n",ans);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:34: error: no matching function for call to 'min(int, long long int&)'
   30 |                 for(ll j=1;j<=min(30,i);j++)
      |                               ~~~^~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:30:34: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   30 |                 for(ll j=1;j<=min(30,i);j++)
      |                               ~~~^~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:30:34: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   30 |                 for(ll j=1;j<=min(30,i);j++)
      |                               ~~~^~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define fi first
#define se second
#define lb lower_bound
#define ub upper_bound
const int mod = 1e9+7;
const int mx = INT_MAX;
const ll inf = (ll)1e16;
const long double pi = 4*atan((long double)1);
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef vector<pii> vii;
#define file "orz"
ll dp[3][40],n,t,ans;
bool compare(pii a, pii b)
{
	return a.fi*(b.se+1) > b.fi*(a.se+1);
}
int main()	
{
	//freopen(file".inp","r",stdin);
	//freopen(file".out","w",stdout);
	ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	cin>>n>>t;
	vector<pii> arr;
	vector<ll> zero;
	for(int i=0;i<n;i++)
	{
		pii temp;
		cin>>temp.fi>>temp.se;
		if(temp.fi == 0)
			zero.eb(temp.se);
		else
			arr.eb(temp);
	}
	sort(arr.begin(),arr.end(),compare);
	for(int i=0;i<2;i++)
		for(int j=0;j<33;j++)
			dp[i][j] = inf;
	dp[0][0] = 0;
	for(int i=0;i<arr.size();i++)
	{
		for(int j=0;j<33;j++)
			dp[(i+1)&1][j] = inf;
		auto s = arr[i];
		for(int j=0;j<33;j++)
		{
			if(dp[i&1][j]==inf)
				continue;
			dp[(i+1)&1][j] = min(dp[(i+1)&1][j],dp[i&1][j]);
			ll check = (dp[i&1][j]+1)*(s.fi+1)+s.se;
			if(check<=t and j+1<33)
				dp[(i+1)&1][j+1] = min(dp[(i+1)&1][j+1],check);	
		}	
	}
	sort(zero.begin(),zero.end());
	vector<ll> pref(zero.size()+1);
	pref[0] = 0;
	for(int i=0;i<zero.size();i++)
		pref[i+1] = pref[i]+zero[i]+1;
	for(int j=0;j<33;j++)
	{
		ll res = t-dp[arr.size()&1][j];
		if(res<0)
			continue;
		ans = max(ans,(ll)(upper_bound(pref.begin(),pref.end(),res)+j-1));
	}
	cout<<ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:71:31: error: invalid cast from type '__gnu_cxx::__normal_iterator<long long int*, std::vector<long long int> >' to type 'long long int'
   71 |                 ans = max(ans,(ll)(upper_bound(pref.begin(),pref.end(),res)+j-1));
      |                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define fi first
#define se second
#define lb lower_bound
#define ub upper_bound
const int mod = 1e9+7;
const int mx = INT_MAX;
const ll inf = (ll)1e16;
const long double pi = 4*atan((long double)1);
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef vector<pii> vii;
#define file "orz"
ll dp[3][40],n,t,ans;
bool compare(pii a, pii b)
{
	return a.fi*(b.se+1) > b.fi*(a.se+1);
}
int main()	
{
	//freopen(file".inp","r",stdin);
	//freopen(file".out","w",stdout);
	ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	cin>>n>>t;
	vector<pii> arr;
	vector<ll> zero;
	for(int i=0;i<n;i++)
	{
		pii temp;
		cin>>temp.fi>>temp.se;
		if(temp.fi == 0)
			zero.eb(temp.se);
		else
			arr.eb(temp);
	}
	sort(arr.begin(),arr.end(),compare);
	for(int i=0;i<2;i++)
		for(int j=0;j<33;j++)
			dp[i][j] = inf;
	dp[0][0] = 0;
	for(int i=0;i<arr.size();i++)
	{
		for(int j=0;j<33;j++)
			dp[(i+1)&1][j] = inf;
		auto s = arr[i];
		for(int j=0;j<33;j++)
		{
			if(dp[i&1][j]==inf)
				continue;
			dp[(i+1)&1][j] = min(dp[(i+1)&1][j],dp[i&1][j]);
			ll check = (dp[i&1][j]+1)*(s.fi+1)+s.se;
			if(check<=t and j+1<33)
				dp[(i+1)&1][j+1] = min(dp[(i+1)&1][j+1],check);	
		}	
	}
	sort(zero.begin(),zero.end());
	vector<ll> pref(zero.size()+1);
	pref[0] = 0;
	for(int i=0;i<zero.size();i++)
		pref[i+1] = pref[i]+zero[i]+1;
	for(int j=0;j<33;j++)
	{
		ll res = t-dp[arr.size()&1][j];
		if(res<0)
			continue;
		ans = max(ans,(ll)(upper_bound(pref.begin(),pref.end(),res+j-1));
	}
	cout<<ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:71:31: error: invalid cast from type '__gnu_cxx::__normal_iterator<long long int*, std::vector<long long int> >' to type 'long long int'
   71 |                 ans = max(ans,(ll)(upper_bound(pref.begin(),pref.end(),res+j-1));
      |                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include<iostream>
#include<algorithm>
using namespace std;
 
struct node{
  	int a,b;
	float s;
};
 
bool comparator(struct node &a,struct node &b){
	return a.s < b.s;
}
 
int main(){
  
  	int n,t;
  	cin>>n>>t;
  	int a[n],b[n];
  	for(int i=0;i<n;i++){
    	cin>>a[i]>>b[i]
    }
  
  	struct node arr[n];
  	for(int i=0;i<n;i++){
      	arr[i].a = a[i];
      	arr[i].b = b[i];
    	arr[i].s = (1.0*a[i])/(b[i] + 1);
    }
  
  	sort(arr,arr+n,comparator);
  	int current_time = 1;
  	int queue_time = arr[0].a * current_time + arr[0].b;
  	int ans = 0;
  	while(ans<=n && (current_time + queue_time <= (t + 0.5))){
    	ans++;
      	current_time = current_time + queue_time + 1;
      	queue_time = current_time*arr[ans].a + arr[ans].b;
    }
  	cout<<ans;
 
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:24: error: expected ';' before '}' token
   20 |         cin>>a[i]>>b[i]
      |                        ^
      |                        ;
   21 |     }
      |     ~
Language: C++

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

struct node{
  	int a,b;
	float s;
};

bool comparator(struct node &a,struct node &b){
	return a.s < b.s;
}

int main(){
  
  	int n,t;
  	int a[n],b[n];
  	for(int i=0;i<n;i++){
    	cin>>a[i]>>b[i]
    }
  
  	struct node arr[n];
  	for(int i=0;i<n;i++){
      	arr[i].a = a[i];
      	arr[i].b = b[i];
    	arr[i].s = (1.0*a[i])/(b[i] + 1);
    }
  
  	sort(arr,arr+n,comparator);
  	int current_time = 1;
  	int queue_time = arr[i].a * current_time + arr[i].b;
  	int ans = 0;
  	while(current_time + queue_time <= (T + 0.5)){
    	ans++;
      	current_time = current_time + queue_time + 1;
      	queue_time = current_time*arr[ans].a + arr[i].b;
    }
  	cout<<ans;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:24: error: expected ';' before '}' token
   19 |         cin>>a[i]>>b[i]
      |                        ^
      |                        ;
   20 |     }
      |     ~                   
a.cc:31:30: error: 'i' was not declared in this scope
   31 |         int queue_time = arr[i].a * current_time + arr[i].b;
      |                              ^
a.cc:33:45: error: 'T' was not declared in this scope
   33 |         while(current_time + queue_time <= (T + 0.5)){
      |                                             ^
Language: C++

#include <iostream>
#include <bits/stdc++.h>
using namespace std;
#define mp make_pair
#define pb push_back
typedef int64_t llo;
#define a first
#define  b second
#define endl "\n"
bool comp(pair<llo,llo> ac, pair<llo,llo> cc){
	return (cc.b)*ac.a>=(ac.b)*cc.a;
}
int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	llo n,t;
	cin>>n>>t;
	vector<pair<llo,llo>> it;
	vector<llo> tt;
	tt.pb(0);
	llo aa,bb;
	for(llo i=0;i<n;i++){
		cin>>aa>>bb;
		if(aa==0){
			tt.pb(bb+1);
		}
		else{
			it.pb({aa,bb+1});
		}
	}
	if(it.size()){
		sort(it.begin(),it.end(),comp);
	}
	llo dp[33];

	memset(dp,-1,sizeof(dp));
	dp[0]=1s;
	for(llo i=0;i<it.size();i++){
//	cout<<it[i].a<<" "<<it[i].b<<endl;
		for(llo j=32;j>=1;j--){
			if(dp[j-1]==-1){
				continue;
			}
			//cout<<i<<" "<<j<<endl;
			llo co=(dp[j-1])*it[i].a+it[i].b+dp[j-1];
			if(dp[j]==-1){
				dp[j]=co;
			}
			dp[j]=min(dp[j],co);
		}
	}	

	llo ma=0;
	llo j=tt.size()-1;
	if(tt.size()){
		sort(tt.begin(),tt.end());
	}
	for(int i=1;i<tt.size();i++){
		tt[i]+=tt[i-1];
	}
	for(llo i=0;i<33;i++){
		if(dp[i]==-1){
			continue;
		}
		
		while(j>=0 and dp[i]+tt[j]>t){
			j-=1;
		}
		if(j<0){
			continue;
		}
		ma=max(ma,i+j);
	}	
	cout<<ma<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:15: error: cannot convert 'std::chrono::seconds' {aka 'std::chrono::duration<long int>'} to 'llo' {aka 'long int'} in assignment
   37 |         dp[0]=1s;
      |               ^~
      |               |
      |               std::chrono::seconds {aka std::chrono::duration<long int>}
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
using ll = long long;
using P = pair<ll,ll>;

int n, t, a, b, e[2], ans;
long long dp[35], ac, INF = 1e9+7;
P s[2][200005];

int main(){
	scanf("%d%d", &n, &t); t++;
	rep(i,n){
		scanf("%d%d", &a, &b);
		s[!a][e[!a]++] = {a+1,b+1};
	}
	sort(s[0], s[0]+e[0], [](P &a, P &b){

	sort(s[1], s[1]+e[1]);
	fill(dp,dp+30, INF);
	dp[0] = 1;
	rep(i,e[0]) for(int j=29; j>0; j--){
		dp[j] = min(dp[j], dp[j-1] * s[0][i].first + s[0][i].second);
	}
	rep(i,e[1]+1){
		ans = max(ans,(int)(i+upper_bound(dp, dp+30, t-ac)-dp-1));
		if(i<e[1]){
			ac += s[1][i].second;
			if(t <= ac) break;
		}
	}
	printf("%d\n", ans);
	return 0; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:2: error: expected ')' at end of input
   34 | }
      |  ^
      |  )
a.cc:17:13: note: to match this '('
   17 |         sort(s[0], s[0]+e[0], [](P &a, P &b){
      |             ^
a.cc:34:2: error: expected '}' at end of input
   34 | }
      |  ^
a.cc:11:11: note: to match this '{'
   11 | int main(){
      |           ^
Language: C++

#include<bits/stdc++.h>
#define inf 0x3f3f3f3f
using namespace std;
typedef long long ll;
const ll N=2e5+5;
ll n,tot1,tot2,T;
ll b[N];
struct node
{
    ll a,b;
    bool operator<(const node&o)const
    {
        return (ll)o.a*(b+1)<(ll)a*(o.b+1);
    }
}a[N];
ll dp[N][31];
int main()
{
    scanf("%lld%lld",&n,&T);
    for(ll i=1;i<=n;i++)
    {
        ll x,y;scanf("%lld%lld",&x,&y);
        y+=x+1;
        if(x==0) b[++tot1]=y;
        else a[++tot2]={x,y};
    }
    sort(b+1,b+1+tot1);
    for(ll i=2;i<=tot1;i++) b[i]+=b[i-1];
    sort(a+1,a+1+tot2);
    memset(dp,inf,sizeof(dp));
    dp[0][0]=0;
    for(ll i=0;i<tot2;i++)
        for(ll j=0;j<=min(i,30);j++)
        if(dp[i][j]<=T)
    {
        dp[i+1][j]=min(dp[i+1][j],dp[i][j]);
        if(j+1<=30)
            dp[i+1][j+1]=min(dp[i+1][j+1],dp[i][j]+a[i+1].a*dp[i][j]+a[i+1].b);
    }
    ll ans=0;
    for(ll i=1;i<=30;i++)
        if(dp[tot2][i]<=T)
        {
            ll pos=upper_bound(b+1,b+1+tot1,T-dp[tot2][i])-b-1;
            ans=max(ans,i+pos);
        }
    printf("%lld\n",ans);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:33:26: error: no matching function for call to 'min(ll&, int)'
   33 |         for(ll j=0;j<=min(i,30);j++)
      |                       ~~~^~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:33:26: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   33 |         for(ll j=0;j<=min(i,30);j++)
      |                       ~~~^~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:33:26: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   33 |         for(ll j=0;j<=min(i,30);j++)
      |                       ~~~^~~~~~
Language: C++

#include<iostream>
#include<cstdio>
#include<cstring>
#include<vector>
#include<algorithm>
#include<cmath>
using namespace std;
#define INF 0x3f3f3f3f
#define int long long
const int maxn=2e5+10;  //2e5
#define _rep(i,a,b) for(int i=(a);i<=(b);++i)
int n,m,T,cnt,ans;
long long f[maxn],sumex0[maxn];
struct Node
{
    int a,b;
}store[maxn],ex0[maxn];

bool cmp(Node i,Node j)
{
    return j.a*(i.b+1)<i.a*(j.b+1);
}
bool cmp2(Node A,Node B)
{
    return A.b<B.b;
}
int main()
{
    #ifdef __LOCAL__
        freopen("1.in","r",stdin);
        freopen("1.out","w",stdout);
    #endif
    scanf("%d%d",&n,&T);
    _rep(i,1,n)
    {
        scanf("%d%d",&store[i].a,&store[i].b);
        if(store[i].a==0)
        {
            ++cnt;
            ex0[cnt].a=store[i].a;
            ex0[cnt].b=store[i].b;
        }
    }   
    sort(store+1,store+1+n,cmp);
    sort(ex0+1,ex0+1+cnt,cmp2);
    m=n-cnt;
    // _rep(i,1,n)
    //     cout<<i<<" "<<store[i].a<<" "<<store[i].b<<endl;
    // _rep(i,1,cnt)
    //     cout<<i<<" "<<ex0[i].a<<" "<<ex0[i].b<<endl;
    memset(f,0x3f,sizeof(f));
    f[0]=0;
    _rep(i,1,m)
        _rep(j,1,30)
            if(j<=i)
                f[j]=min(f[j],(f[j-1]+1)*(store[i].a+1)+store[i].b);
    _rep(i,1,cnt)
        sumex0[i]=sumex0[i-1]+ex0[i].b+1;
    _rep(i,1,30)
    {
        // cout<<i<<" "<<f[i]<<endl;
        if(f[i]>T) continue;
        int pos=upper_bound(sumex0+1,sumex0+cnt+1,T-f[i])-sumex0;        
        ans=max(ans,i+pos-1);
        // cout<<pos<<" "<<i+pos-1<<endl;
    }  
    cout<<ans<<endl;
    
    return 0;
}

Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C++

#include<iostream>
#include<cstdio>
#include<cstring>
#include<vector>
#include<algorithm>
#include<cmath>
using namespace std;
#define INF 0x3f3f3f3f
const int maxn=1e5+10;  //2e5
#define _rep(i,a,b) for(int i=(a);i<=(b);++i)
int n,T,ans;
long long f[maxn][maxn];
struct Node
{
    int a,b;
}store[maxn];


bool cmp(Node i,Node j)
{
    return j.a*(i.b+1)<i.a*(j.b+1);
}

int main()
{
    #ifdef __LOCAL__
        freopen("1.in","r",stdin);
        freopen("1.out","w",stdout);
    #endif
    scanf("%d%d",&n,&T);
    _rep(i,1,n)
        scanf("%d%d",&store[i].a,&store[i].b);
    sort(store+1,store+1+n,cmp);
    memset(f,0x3f,sizeof(f));
    _rep(i,0,n)
        f[i][0]=0;
    _rep(i,1,n)
        _rep(j,1,n)
            f[i][j]=min(f[i-1][j],(f[i][j-1]+1)+(f[i][j-1]+1)*store[i].a+store[i].b);
    _rep(i,1,n)
    {
        // cout<<f[n][i]<<" ";
        if(f[n][i]<=T)
            ans=max(ans,i);
    }
    // cout<<endl;    
    cout<<ans<<endl;
    
    return 0;
}

Compiler output:
/tmp/ccxbPrHf.o: in function `main':
a.cc:(.text+0x74): relocation truncated to fit: R_X86_64_PC32 against symbol `store' defined in .bss section in /tmp/ccxbPrHf.o
a.cc:(.text+0x8f): relocation truncated to fit: R_X86_64_PC32 against symbol `store' defined in .bss section in /tmp/ccxbPrHf.o
a.cc:(.text+0xd3): relocation truncated to fit: R_X86_64_PC32 against symbol `store' defined in .bss section in /tmp/ccxbPrHf.o
a.cc:(.text+0xde): relocation truncated to fit: R_X86_64_PC32 against symbol `store' defined in .bss section in /tmp/ccxbPrHf.o
a.cc:(.text+0x1ce): relocation truncated to fit: R_X86_64_PC32 against symbol `store' defined in .bss section in /tmp/ccxbPrHf.o
a.cc:(.text+0x1ef): relocation truncated to fit: R_X86_64_PC32 against symbol `store' defined in .bss section in /tmp/ccxbPrHf.o
collect2: error: ld returned 1 exit status
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
#define INF (1 << 30) - 1;
 
bool cmp(P p, P q){
  return p.first * (q.second + 1) >= q.first * (p.second + 1);
}
 
vector<vector<ll>> dp(200100, vector<ll>(35));
 
int main(){
  ll n, T;
  cin >> n >> T;
 
  vector<ll> b;
  vector<P> a_b;
  for(int i = 0; i < n; ++i){
    ll a_, b_;
    cin >> a_ >> b_;
    if(a_ == 0)b.push_back(b_ + 1);
    else a_b.push_back(P(a_, b_));
  }
 
  sort(a_b.begin(), a_b.end(), cmp);
  sort(b.begin(), b.end());
 
  for(int i = 0; i < 200100; ++i){
    for(int j = 0; j < 33; ++j){
      dp[i][j] = INF;
    }
    dp[i][0] = 0; 
  }
 
  for(int i = 0; i < a_b.size(); ++i){
    ll a = a_b[i].first;
    ll b = a_b[i].second;
    for(int j = 0; j < 32; ++j){ 
      if(j > i)break;
      dp[i + 1][j + 1] = min(dp[i + 1][j + 1], (a + 1) * dp[i][j] + a + b + 1);
      dp[i + 1][j] = min(dp[i][j], dp[i + 1][j]);
    }
  }
 
  ll count = 0;
  for(int i = 0; i < 32 + 1; ++i){ 
    ll cur = dp[a_b.size()][i];
    if(cur > T)break;
    ll tmp_count = 0;
    for(int j = 0; j < b.size(); ++j){
      cur += b[j];
      if(cur > T)break;
      ++tmp_count;
    }
    if(count < i + tmp_count){
      count = i + tmp_count;
    }
  }
  
  cout << count << endl;
 
  return 0;

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

import sys
from bisect import bisect
from itertools import accumulate
import numpy as np

n, t, *ab = map(int, sys.stdin.buffer.read().split())
constant = []
variable = []
for a, b in zip(ab[0::2], ab[1::2]):
    if a == 0:
        constant.append(b + 1)
    else:
        variable.append((a / (b + 1), a, b))
constant.sort()
variable.sort(reverse=True)
INF = 10 ** 10
t += 1
t2 = t.bit_length() + 1
# dp[j]: (i番目まで見て) j件の店で買い物を完了した時の、次の店に到着できる最短時間
dp = np.full(t2, INF, dtype=np.int64)
dp[0] = 1
for _, a, b in variable:
    ndp = (a + 1) * dp + b + 1
    dp[1:] = np.minimum(dp[1:], ndp[:-1])
	dp = dp[dp <= t]

const_acc = np.cumsum(constant)
extra = np.searchsorted(const_acc, t - dp, side='right')
print((np.arange(len(extra)) + extra).max())


Compiler output:
a.cc:19:3: error: invalid preprocessing directive #dp
   19 | # dp[j]: (i番目まで見て) j件の店で買い物を完了した時の、次の店に到着できる最短時間
      |   ^~
a.cc:19:26: error: extended character 、 is not valid in an identifier
   19 | # dp[j]: (i番目まで見て) j件の店で買い物を完了した時の、次の店に到着できる最短時間
      |                          ^
a.cc:28:49: warning: multi-character literal with 5 characters exceeds 'int' size of 4 bytes
   28 | extra = np.searchsorted(const_acc, t - dp, side='right')
      |                                                 ^~~~~~~
a.cc:1:1: error: 'import' does not name a type
    1 | import sys
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n)  for(long long i=0;i<(long long)(n);i++)
#define REP(i,k,n) for(long long i=k;i<(long long)(n);i++)
#define all(a) a.begin(),a.end()
#define pb push_back
#define eb emplace_back
#define lb(v,k) (lower_bound(all(v),k)-v.begin())
#define ub(v,k) (upper_bound(all(v),k)-v.begin())
#define fi first
#define se second
#define pi M_PI
typedef long long ll;
typedef pair<ll,ll> P;
typedef tuple<ll,ll,ll> PP;
typedef multiset<ll> S;
typedef priority_queue<ll> PQ;
typedef priority_queue<P,vector<P>,greater<P>> SPQ;
using vi=vector<ll>;
using vvi=vector<vi>;
using vvvi=vector<vvi>;
const ll inf=1001001001001001;
const int INF=1001001001;
const int mod=1000000007;
template<class T> bool chmin(T&a,T b){if(a>b){a=b;return true;}return false;}
template<class T> bool chmax(T&a,T b){if(a<b){a=b;return true;}return false;}
template<class T> void out(T a){cout<<a<<'\n';}
template<class T> void outp(T a){cout<<'('<<a.fi<<','<<a.se<<')'<<'\n';}
template<class T> void outvp(T v){rep(i,v.size())outp(v[i]);}
template<class T> void outv(T v){rep(i,v.size()){if(i)cout<<' ';cout<<v[i];}cout<<'\n';}
template<class T> void outvv(T v){rep(i,v.size()){rep(j,v[i].size()){if(j)cout<<' ';cout<<v[i][j];}cout<<'\n';}}
ll gcd(ll a,ll b){if(b==0)return a;return gcd(b,a%b);}
ll modpow(ll a,ll b){a%=mod;if(b==0)return 1;if(b&1)return a*modpow(a,b-1)%mod;ll k=modpow(a,b/2);return k*k%mod;}

int main(){
    ll n,t;cin>>n>>t;
    vector<P> v(n);
    rep(i,n){
        ll a,b;cin>>a>>b;
        v[i]=P(a+1,a+b+1);
    }
    vector<P> s;
    vi u;
    rep(i,n){
        if(v[i].fi-1>0)s.eb((v[i].fi-1)/(v[i].se-v[i].fi+1),i);
        else u.pb(v[i].se-v[i].fi+1);
    }
    sort(all(s));
    sort(all(u));
    n=s.size();
    if(n==0){
        ll ans=ub(rui,t);
        out(ans);
        return 0;
    }
    ll ans=0;
    vvi dp(n,vi(32,t+3));
    dp[0][0]=0;
    dp[0][1]=v[s[0].se].se;
    rep(i,n-1){
        rep(j,31){
            if(dp[i][j]>t)continue;
            ll id=s[i+1].se;
            if(dp[i][j]*v[id].fi+v[id].se<=t)chmin(dp[i+1][j+1],dp[i][j]*v[id].fi+v[id].se);
            chmin(dp[i+1][j],dp[i][j]);
        }
    }
    //outvv(dp);
    rep(i,32)if(dp[n-1][i]<=t){
        int cnt=0;
        while(cnt<u.size()&&u[cnt]+dp[n-1][i]<=t){
            dp[n-1][i]+=u[cnt];
            cnt++;
        }
        //cout<<i<<' '<<ub(rui,t-dp[n-1][i])<<endl;
        chmax(ans,i+cnt);
    }
    out(ans);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:52:19: error: 'rui' was not declared in this scope
   52 |         ll ans=ub(rui,t);
      |                   ^~~
a.cc:5:16: note: in definition of macro 'all'
    5 | #define all(a) a.begin(),a.end()
      |                ^
a.cc:52:16: note: in expansion of macro 'ub'
   52 |         ll ans=ub(rui,t);
      |                ^~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n)  for(long long i=0;i<(long long)(n);i++)
#define REP(i,k,n) for(long long i=k;i<(long long)(n);i++)
#define all(a) a.begin(),a.end()
#define pb push_back
#define eb emplace_back
#define lb(v,k) (lower_bound(all(v),k)-v.begin())
#define ub(v,k) (upper_bound(all(v),k)-v.begin())
#define fi first
#define se second
#define pi M_PI
typedef long long ll;
typedef pair<ll,ll> P;
typedef tuple<ll,ll,ll> PP;
typedef multiset<ll> S;
typedef priority_queue<ll> PQ;
typedef priority_queue<P,vector<P>,greater<P>> SPQ;
using vi=vector<ll>;
using vvi=vector<vi>;
using vvvi=vector<vvi>;
const ll inf=1001001001001001;
const int INF=1001001001;
const int mod=1000000007;
template<class T> bool chmin(T&a,T b){if(a>b){a=b;return true;}return false;}
template<class T> bool chmax(T&a,T b){if(a<b){a=b;return true;}return false;}
template<class T> void out(T a){cout<<a<<'\n';}
template<class T> void outp(T a){cout<<'('<<a.fi<<','<<a.se<<')'<<'\n';}
template<class T> void outvp(T v){rep(i,v.size())outp(v[i]);}
template<class T> void outv(T v){rep(i,v.size()){if(i)cout<<' ';cout<<v[i];}cout<<'\n';}
template<class T> void outvv(T v){rep(i,v.size()){rep(j,v[i].size()){if(j)cout<<' ';cout<<v[i][j];}cout<<'\n';}}
ll gcd(ll a,ll b){if(b==0)return a;return gcd(b,a%b);}
ll modpow(ll a,ll b){a%=mod;if(b==0)return 1;if(b&1)return a*modpow(a,b-1)%mod;ll k=modpow(a,b/2);return k*k%mod;}

int main(){
    ll n,t;cin>>n>>t;
    vector<P> v(n);
    rep(i,n){
        ll a,b;cin>>a>>b;
        v[i]=P(a+1,a+b+1);
    }
    vector<P> s;
    vi u;
    rep(i,n){
        if(v[i].fi-1>0)s.eb((v[i].fi-1)/(v[i].se-v[i].fi+1),i);
        else u.pb(v[i].se-v[i].fi+1);
    }
    sort(all(s));
    sort(all(u));
    n=s.size();
    if(n==0){
        ll ans=ub(rui,t);
        out(ans);
        return 0;
    }
    vvi dp(n,vi(32,t+3));
    dp[0][0]=0;
    dp[0][1]=v[s[0].se].se;
    rep(i,n-1){
        rep(j,31){
            if(dp[i][j]>t)continue;
            ll id=s[i+1].se;
            if(dp[i][j]*v[id].fi+v[id].se<=t)chmin(dp[i+1][j+1],dp[i][j]*v[id].fi+v[id].se);
            chmin(dp[i+1][j],dp[i][j]);
        }
    }
    //outvv(dp);
    rep(i,32)if(dp[n-1][i]<=t){
        int cnt=0;
        while(cnt<u.size()&&u[cnt]+dp[n-1][i]<=t){
            dp[n-1][i]+=u[cnt];
            cnt++;
        }
        //cout<<i<<' '<<ub(rui,t-dp[n-1][i])<<endl;
        chmax(ans,i+cnt);
    }
    out(ans);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:52:19: error: 'rui' was not declared in this scope
   52 |         ll ans=ub(rui,t);
      |                   ^~~
a.cc:5:16: note: in definition of macro 'all'
    5 | #define all(a) a.begin(),a.end()
      |                ^
a.cc:52:16: note: in expansion of macro 'ub'
   52 |         ll ans=ub(rui,t);
      |                ^~
a.cc:75:15: error: 'ans' was not declared in this scope; did you mean 'abs'?
   75 |         chmax(ans,i+cnt);
      |               ^~~
      |               abs
a.cc:77:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   77 |     out(ans);
      |         ^~~
      |         abs