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

#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#define lson l,mid,rt<<1
#define rson mid+1,r,rt<<1|1
using namespace std;
typedef double DB;
const int N = 100010;
set<pair<int,int> > st;
set<pair<int,int> >::iterator it;
pair<int,int> a[N],b;
int main(void) {
	int n,t,res;
	scanf("%d",&t);
	while(t--) {
		scanf("%d",&n);
		for(int i=0;i<n;i++) scanf("%d%d",&a[i].first,&a[i].second);
		st.clear();
		for(int i=0;i<n;i++) {
			scanf("%d%d",&b.first,&b.second);
			st.insert(b);
		}
		for(int i=res=0;i<n;i++) {
			it=st.lower_bound(a[i]);
			if(it==st.begin()) {
				if(!(a[i].first>=(*it).first&&a[i].second>=(*it).second)) continue;
			}
			else it--;
			if(a[i].first>=(*it).first && a[i].second>=(*it).second ) {
				res++;
				st.erase(it);
			}
		}
		printf("%d\n",res);
	}
	return 0;
}

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

#include<cstdio>
#include<cstring>
#include<algorithm>
#include <map>
using namespace std;

const int MAX = 100010;
int arr[MAX],n,tot;

int low(int x)
{
    return x&(-x);
}

void add(int pos,int v)
{
    for(int i=pos; i<=tot; i+=low(i))
        arr[i] += v;
}

int sum(int pos)
{
    int ret = 0;
    for(int i=pos; i; i-=low(i))
        ret += arr[i];
    return ret;
}

#define clr(a,b)    memset(a,b,sizeof(a))
int T;

struct st
{
    int h,w;
}a[MAX],b[MAX];

bool cmp(const st&a, const st& b)
{
    if(a.h == b.h)  return a.w < b.w;
    return a.h < b.h;
}

int num[MAX*2];

map<int,int> hash;

int main()
{
    //freopen("in","r",stdin);
    scanf("%d",&T);
    while(T--)
    {
        hash.clear();

        scanf("%d",&n);
        for(int i=1; i<=n; i++) scanf("%d%d",&a[i].h, &a[i].w);
        for(int i=1; i<=n; i++) scanf("%d%d",&b[i].h, &b[i].w);
        sort(a+1,a+1+n,cmp);
        sort(b+1,b+1+n,cmp);

        for(int i=1; i<=n; i++) num[i] = a[i].w;
        for(int i=1; i<=n; i++) num[i+n] = b[i].w;
        sort(num+1,num+1+2*n);

//        for(int i=1; i<=2*n; i++)
//            printf("%d ",num[i]);
//        puts("");


        int q = unique(num+1,num+1+2*n) - (num+1);
        tot = q;
//        printf("q:%d\n",q);

//        for(int i=1; i<=q; i++)
//            printf("%d ",num[i]);
//        puts("");


        for(int i=1; i<=q; i++) hash.insert( make_pair(num[i],i) );

        int ans = 0;

        clr(arr,0);
        int p = 1, pre = 1;
        for(int i=1; i<=n; )
        {
            while(a[i].h == a[i+1].h)   i++;

            for(; p<=n && b[p].h <= a[i].h; p++)
            {
                int t = hash[b[p].w];
                add(t, 1);
            }

            for(; pre<=i; pre++)
            {
                int t = hash[ a[pre].w ];
                int s = sum( t );
                if(s > 0)
                {
                    ans ++;
                    add(t, -1);
                }
            }

            i++;
            pre=i;
        }
        printf("%d\n",ans);
    }
}

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

#include<cstdio>
#include<cstring>
#include<algorithm>
#include <map>
using namespace std;

const int MAX = 100010;
int arr[2*MAX],arr2[2*MAX],n,tot;

int low(int x)
{
    return x&(-x);
}

void add(int arr[], int pos,int v)
{
    for(int i=pos; i<=tot; i+=low(i))
        arr[i] += v;
}

int sum(int arr[], int pos)
{
    int ret = 0;
    for(int i=pos; i; i-=low(i))
        ret += arr[i];
    return ret;
}

int find(int arr[], int x)
{
    int pos = 0;
    for(int i=1<<18; i>=1; i>>=1)
    {
        if(pos+i < n && arr[i+pos])
        {
            x-=arr[i+pos];
            pos += i;
        }
    }return pos+1;
}

#define clr(a,b)    memset(a,b,sizeof(a))
int T;

struct st
{
    int h,w;
}a[MAX],b[MAX];

bool cmp(const st&a, const st& b)
{
    if(a.h == b.h)  return a.w < b.w;
    return a.h < b.h;
}

int num[MAX*2];

map<int,int> hash;

int main()
{
    //freopen("in","r",stdin);
    scanf("%d",&T);
    while(T--)
    {
        hash.clear();

        scanf("%d",&n);
        for(int i=1; i<=n; i++) scanf("%d%d",&a[i].h, &a[i].w);
        for(int i=1; i<=n; i++) scanf("%d%d",&b[i].h, &b[i].w);
        sort(a+1,a+1+n,cmp);
        sort(b+1,b+1+n,cmp);

        for(int i=1; i<=n; i++) num[i] = a[i].w;
        for(int i=1; i<=n; i++) num[i+n] = b[i].w;
        sort(num+1,num+1+2*n);

        int q = unique(num+1,num+1+2*n) - (num+1);
        tot = q;

        for(int i=1; i<=q; i++) hash.insert( make_pair(num[i],i) );

        int ans = 0;

        clr(arr,0),clr(arr2,0);
        int p = 1, pre = 1;
        for(int i=1; i<=n; )
        {
            while(a[i].h == a[i+1].h)   i++;

            for(; p<=n && b[p].h <= a[i].h; p++)
            {
                int t = hash[b[p].w];
                add(arr, t, 1);
                if(sum(arr,t) - sum(arr,t-1) == 1)
                    add(arr2, t, 1);
            }

            for(; pre<=i; pre++)
            {
                int t = hash[ a[pre].w ];
                int cnt = sum(arr2,t);

                if(cnt > 0)
                {
                    int pp = find(arr2, cnt);
                    add(arr,pp,-1);
                    if(sum(arr,pp)-sum(arr,pp-1) == 0)
                        add(arr2,pp,-1);
                    ans++;
                }
            }

            i++;
            pre=i;
        }
        printf("%d\n",ans);
    }
}

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

#include<cstdio>
#include<algorithm>
#include<cstring>
#include<set>
#include<iostream>
using namespace std;

int a[20],c[3],n,t;
typedef pair<int,int>p;
set<p>s;

void dfs(int k)
{
    if(k==n)
    {
        int d[3];
        for(int i=0;i<3;i++) d[i]=c[i];
        sort(d,d+3);
for(int i=0;i<3;i++) if(c[i]!=d[i]) return;
      if(d[2]>=d[1]+d[0]||d[0]==0||d[1]==0||d[2]==0) return;

        s.insert(p(d[0],d[1]));
        return;
    }
    for(int i=0;i<3;i++)
    {
        c[i]+=a[k];
        dfs(k+1);
        c[i]-=a[k];
    }
}
int main()
{
    cin>>t;
    while(t--)
    {
        s.clear();
        cin>>n;
        memset(c,0,sizeof(c));
        for(int i=0;i<n;i++) cin>>a[i];
        dfs(0);
        cout<<s.size()<<endl;
    }
    return 0;
}

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

200
0 1 0 0
0 2 0 0
0 3 0 0
0 4 0 0
0 5 0 0
1 6 1 1
0 7 0 1
1 8 1 2
1 9 1 3
1 10 3 4
0 11 0 4
1 12 3 5
0 13 0 5
1 14 5 6
0 15 4 6
0 16 4 6
0 17 0 6
1 18 7 7
0 19 0 7
1 20 7 8
0 21 6 8
1 22 9 9
0 23 0 9
1 24 9 10
1 25 3 11
1 26 11 12
0 27 6 12
1 28 11 13
0 29 0 13
1 30 15 14
0 31 0 14
1 32 11 15
0 33 10 15
1 34 15 16
0 35 8 16
0 36 16 16
0 37 0 16
1 38 17 17
0 39 12 17
1 40 17 18
0 41 0 18
1 42 23 19
0 43 0 19
1 44 19 20
0 45 16 20
1 46 21 21
0 47 0 21
1 48 23 22
1 49 5 23
1 50 25 24
0 51 16 24
1 52 23 25
0 53 0 25
1 54 29 26
0 55 12 26
1 56 25 27
0 57 18 27
1 58 27 28
0 59 0 28
1 60 33 29
0 61 0 29
1 62 29 30
0 63 22 30
0 64 26 30
0 65 14 30
1 66 39 31
0 67 0 31
1 68 31 32
0 69 22 32
1 70 39 33
0 71 0 33
1 72 37 34
0 73 0 34
1 74 35 35
0 75 30 35
1 76 35 36
0 77 14 36
1 78 47 37
0 79 0 37
1 80 39 38
1 81 23 39
1 82 39 40
0 83 0 40
1 84 49 41
0 85 18 41
1 86 41 42
0 87 28 42
1 88 41 43
0 89 0 43
1 90 55 44
0 91 16 44
1 92 43 45
0 93 30 45
1 94 45 46
0 95 20 46
1 96 53 47
0 97 0 47
1 98 51 48
0 99 34 48
0 100 52 48
0 101 0 48
1 102 63 49
0 103 0 49
1 104 49 50
0 105 50 50
1 106 51 51
0 107 0 51
1 108 61 52
0 109 0 52
1 110 63 53
0 111 36 53
1 112 55 54
0 113 0 54
1 114 71 55
0 115 24 55
1 116 55 56
0 117 40 56
1 118 57 57
0 119 20 57
1 120 73 58
1 121 9 59
1 122 59 60
0 123 40 60
1 124 59 61
0 125 22 61
1 126 79 62
0 127 0 62
1 128 57 63
0 129 42 63
1 130 75 64
0 131 0 64
1 132 81 65
0 133 22 65
1 134 65 66
0 135 56 66
1 136 65 67
0 137 0 67
1 138 87 68
0 139 0 68
1 140 81 69
0 141 46 69
1 142 69 70
0 143 20 70
0 144 82 70
0 145 30 70
1 146 71 71
0 147 58 71
1 148 71 72
0 149 0 72
1 150 99 73
0 151 0 73
1 152 73 74
0 153 52 74
1 154 87 75
0 155 32 75
1 156 97 76
0 157 0 76
1 158 77 77
0 159 52 77
1 160 85 78
0 161 26 78
1 162 99 79
0 163 0 79
1 164 79 80
0 165 78 80
1 166 81 81
0 167 0 81
1 168 105 82
1 169 11 83
1 170 99 84
0 171 58 84
1 172 83 85
0 173 0 85
1 174 111 86
0 175 50 86
1 176 87 87
0 177 58 87
1 178 87 88
0 179 0 88
1 180 115 89
0 181 0 89
1 182 103 90
0 183 60 90
1 184 89 91
0 185 38 91
1 186 119 92
0 187 24 92
1 188 91 93
0 189 74 93
1 190 111 94
0 191 0 94
1 192 115 95
0 193 0 95
1 194 95 96
0 195 92 96
0 196 104 96
0 197 0 96
1 198 127 97
0 199 0 97
1 200 109 98
0
  

Compiler output:
main.c:1:1: error: expected identifier or '(' before numeric constant
    1 | 200
      | ^~~
Language: C

1 0
2 0
3 0
4 0
5 0
6 1
7 1
8 2
9 3
10 4
11 4
12 5
13 5
14 6
15 6
16 6
17 6
18 7
19 7
20 8
21 8
22 9
23 9
24 10
25 11
26 12
27 12
28 13
29 13
30 14
31 14
32 15
33 15
34 16
35 16
36 16
37 16
38 17
39 17
40 18
41 18
42 19
43 19
44 20
45 20
46 21
47 21
48 22
49 23
50 24
51 24
52 25
53 25
54 26
55 26
56 27
57 27
58 28
59 28
60 29
61 29
62 30
63 30
64 30
65 30
66 31
67 31
68 32
69 32
70 33
71 33
72 34
73 34
74 35
75 35
76 36
77 36
78 37
79 37
80 38
81 39
82 40
83 40
84 41
85 41
86 42
87 42
88 43
89 43
90 44
91 44
92 45
93 45
94 46
95 46
96 47
97 47
98 48
99 48
100 48
101 48
102 49
103 49
104 50
105 50
106 51
107 51
108 52
109 52
110 53
111 53
112 54
113 54
114 55
115 55
116 56
117 56
118 57
119 57
120 58
121 59
122 60
123 60
124 61
125 61
126 62
127 62
128 63
129 63
130 64
131 64
132 65
133 65
134 66
135 66
136 67
137 67
138 68
139 68
140 69
141 69
142 70
143 70
144 70
145 70
146 71
147 71
148 72
149 72
150 73
151 73
152 74
153 74
154 75
155 75
156 76
157 76
158 77
159 77
160 78
161 78
162 79
163 79
164 80
165 80
166 81
167 81
168 82
169 83
170 84
171 84
172 85
173 85
174 86
175 86
176 87
177 87
178 88
179 88
180 89
181 89
182 90
183 90
184 91
185 91
186 92
187 92
188 93
189 93
190 94
191 94
192 95
193 95
194 96
195 96
196 96
197 96
198 97
199 97
200 98

Compiler output:
main.c:1:1: error: expected identifier or '(' before numeric constant
    1 | 1 0
      | ^
Language: C

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

using namespace std;

#define F first
#define S second
#define MP(x, y) make_pair(x, y)
typedef unsigned long long LL;

LL cal(LL x)
{
	if (x<=2) return 0;
	LL y=(LL)sqrt(x*1.0);
	if ((y+1)*(y+1)<=x) y++;
	LL res=x/2-y/2+(y-1)/2-1;
	//cout<<x<<' '<<res<<endl;
	return res;
}

int main()
{
	LL l,r;
	int o;
	//asdfasdfasdf
	/*for(int i = 2; i <= 1000; i++)
		cout << i<<" " <<cal((LL)i) << endl;
	*/
	scanf("%d",&o);
	while (o--)
	{
		//scanf("%I64u%I64u",&l,&r);
		//printf("%I64u\n",cal(r)-cal(l-1));
		long long ll,  rr;
		//cin >>ll>>rr;
		scanf("%I64d%I64d", &ll, &rr);
		//cin>>l>>r;
		//cout<<cal(r)-cal(l-1)<<endl;
		l = ll, r = rr;
		long long ans = (long long)(cal(r)-cal(l-1));
		printf("%I64d\n", ans);
	}
	return 0;
}

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

#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
int num[50];
double dp[50];
double dfs(int l,bool e)
{
	if(l==-1)	return 1;
	if(!e&&dp[l]!=-1)	return dp[l];
	int u=e?num[l]:1;
	double res=0;
	for(int i=0;i<=u;i++)
	{
		res+=((double)1/((double)2*l)+(double)(l-1)/l*dfs(l-1,e&&i==u));
	}
	return e? res:dp[l];
}
double solve(int n)
{
	int l=0;
	while(n)
	{
		num[l++]=(n&1);
		n>>=1;
	}
	return dfs(l-1,1);
}
int main()
{
	int t,a,b;
	scanf("%d",&t);
	memset(dp,-1,sizeof(dp));
	while(t--)
	{
		scanf("%d%d",&a,&b);
		printf("%.6f",(a*solve(a)+b*solve(b))/(double)(a-b));
	}
	return 0;
}

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

#include<iostream>
#include<cstdio>
#include<string.h>
#include<string>
#include<math.h>
#include<algorithm>
#include<vector>
using namespace std;
#define maxn 1009
#define maxm 300000
#define inf (1<<29)

struct edge{
    int v,flow;
    int next;   
};

edge e[maxm];
int start[maxn];
int nn,n,m,s,t;
int sum;

void init(){
    memset(start,-1,sizeof(start));
    nn=0; 
}

void addedge(int u,int v,int flow){
    e[nn].v=v;
    e[nn].flow=flow;
    e[nn].next=start[u];
    start[u]=nn++;
	
	e[nn].v = u;
	e[nn].flow = 0;
	e[nn].next = start[v];
	start[v] = nn++;
}

int h[maxn],gap[maxn];

int dfs(int pos,int cost){
    if(pos==t) return cost;
    int mi=sum-1;
    int lv=cost,d;
    for(int i=start[pos];i!=-1;i=e[i].next){
        int v=e[i].v;
        int fl=e[i].flow;
        if(fl>0){
            if(h[v]+1==h[pos]){
                d=min(fl,lv);
                d=dfs(v,d);
                e[i].flow-=d;
                e[i^1].flow+=d;
                lv-=d;
                if(h[s]>=sum) return cost-lv;
                if(!lv) break;
            }
            mi=min(mi,h[v]);     
        }    
    }
    if(lv==cost){
        --gap[h[pos]];
        if(!gap[h[pos]]) h[s]=sum;
        h[pos]=mi+1;
        ++gap[h[pos]];
    }
    return cost-lv;
}

int sap(){
    memset(gap,0,sizeof(gap));
    memset(h,0,sizeof(h));
    gap[s]=sum;
    int res=0;
    while(h[s]<sum) res+=dfs(s,inf);
    return res;
}


char str[309];

int main(){
	int F,D;
	while(scanf("%d %d %d",&n,&F,&D)==3){
		init();
		s = 0;t = F+D+n+1;
		sum = t+1;
		for(int i=1;i<=F;i++){
			int w;
			scanf("%d",&w);
			addedge(s,i,w);
		}
		for(int i=1;i<=D;i++){
			int w;
			scanf("%d",&w);
			addedge(F+n+i,t,w);
		}
		for(int i=1;i<=n;i++){
			scanf("%s",str);
			for(int j=1;j<=F;j++){
				if(str[j-1]=='Y') addedge(j,F+i,1);
			}
		}
		for(int i=1;i<=n;i++){
			scanf("%s",str);
			for(int j=1;j<=D;j++){
				if(str[j-1]=='Y') addedge(F+i,F+n+j,1);
			}
		}
		int res = sap();
		printf("%d\n",res);
	}
	return 0;
}

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

#include<stdio.h>
#include<string.h>
#define clr(x,y) memset(x,y,sizeof(x))
#include<algorithm>
#define ll long long
using namespace std;
const int inf=2000000000;

int i,j,n;
struct item{
    int l,r,num;
    bool flag;
}a[1000];
int idx[1000];

bool cmp(const item &a,const item &b){
    if(a.flag!=b.flag) return a.flag<b.flag;
    else return a.r<b.r;
}
int main(){
//    freopen("d:\\in.txt","r",stdin);
    while(scanf("%d",&n)!=EOF){
        clr(a,0);
        for(i=1;i<=n;i++){
            int l,r;
            scanf("%d%d",&l,&r);
            a[i].l=l+1;
            a[i].r=n-r;
            a[i].num=1;
            a[i].flag=0;
        }
        for(i=1;i<=n;i++){
            if(a[i].flag) continue;
            for(j=i+1;j<=n;j++){
                if(a[j].flag) continue;
                if(a[i].l==a[j].l&&a[i].r==a[j].r){
                    a[i].num++;
                    a[j].flag=1;
                }
            }
        }
        for(i=1;i<=n;i++){
            if(a[i].flag) continue;
            if(a[i].l<=0||a[i].r>n){
                a[i].flag=1;
                continue;
            }
            if(a[i].num>(a[i].r-a[i].l+1)){
                a[i].num=a[i].r-a[i].l+1;
            }
        }
        clr(idx,0);
        sort(a+1,a+n+1,cmp);
        for(i=1;i<=n;i++){
            if(a[i].flag) break;
            int maxx=0;
            for(j=1;j<a[i].l;j++)
                maxx=max(maxx,idx[j]);
            idx[a[i].r]=maxx+a[i].num;
        }
        int maxx=0;
        for(i=1;i<=n;i++) maxx=max(idx[i],maxx);
        printf("%d\n",n-maxx);
    }
    return 0;
}

Compiler output:
main.c:4:9: fatal error: algorithm: No such file or directory
    4 | #include<algorithm>
      |         ^~~~~~~~~~~
compilation terminated.
Language: C

#include<iostream>
#include<cstring>
#include<cstdio>
#include<algorithm>
using namespace std;
const int N = 3;
typedef long long LOL;
LOL a[N][N],b[N][N],g[N][N],c[N][N];
LOL dp[100];
LOL mod1=1000000007ll;
LOL mod2=1000000006ll;
LOL mod3=500000002ll;
int sz;
//17
void matcopy(LOL a[N][N],LOL b[N][N])
{
	for(int i=1;i<=sz;i++){
		for(int j=1;j<=sz;j++){
			a[i][j]=b[i][j];
		}
	}
}
void matmul(LOL a[N][N],LOL b[N][N],LOL mod)
{
	memset(c,0,sizeof(c));
	for(int i=1;i<=sz;i++){
		for(int j=1;j<=sz;j++){
			if(a[i][j]){
				for(int k=1;k<=sz;k++){
					c[i][k]+=a[i][j]*b[j][k];
					if(c[i][k]>mod) c[i][k]%=mod;
				}
			}
		}
	}
	matcopy(a,c);
}
void Debug(LOL a[N][N])
{
	for(int i=1;i<=sz;i++)
	{
		for(int j=1;j<=sz;j++)
		{
			cout<<a[i][j]<<" ";
		}
		printf("\n");
	}
}
void matpow(LOL a[N][N],LOL x,LOL mod)
{
	memset(b,0,sizeof(b));
	for(int i=1;i<=sz;i++){
		b[i][i]=1;
	}
	while(x!=0)
	{
		if(x%2) matmul(b,a,mod);
		matmul(a,a,mod);
		x/=2;
	}
	matcopy(a,b);
}
void init()
{
	a[1][1]=3;a[1][2]=1;
	a[2][1]=1;a[2][2]=0;
	g[1][1]=1,g[1][2]=0;
	g[2][1]=0;g[2][2]=0;
}
//36816094379414890
int main(void)
{
	dp[0]=0;dp[1]=1;
	for(int i=2;i<=20;i++){
		dp[i]=dp[i-1]*3+dp[i-2];
	}
	sz=2;
	init();
	LOL n;
	while(cin>>n){
		LOL x,y;
		init();
		if(n<=17){
			x=dp[n]%mod3;
		}else{
			matpow(a,n-1,mod3);
			matmul(g,a,mod3);
			x=g[1][1];
		}
		init();
		cout<<x<<endl;
		if(x<=17){
			y=dp[x]%mod2;
		}else{
			matpow(a,(x-1)%mod3+mod3,mod2);
			matmul(g,a,mod2);
			y=g[1][1];
		}
		cout<<y<<endl;
		init();
		if(y<=17){
			cout<<dp[y]%mod1<<endl;
		}else{
			matpow(a,(y-1)%mod2+mod2,mod1);
			matmul(g,a,mod1);
			cout<<g[1][1]<<endl;
		}
	}
	return 0;
}
/*
 * 4
33
658518329
965544979*/

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

#include<stdio.h>
#include<algorithm>
#include<string.h>
using namespace std;
struct Node {
	int x, y;
	friend bool operator <(struct Node a, struct Node b) {
		if (a.y != b.y)
			return a.y > b.y;
		return a.x < b.x;
	}
	friend bool operator ==(struct Node a, struct Node b) {
		return a.x == b.x && a.y == b.y;
	}
};
#define N 510
#define INF 1000100
int dp[N];
struct Node d[N];
void init(int n) {
	for (int i = 0; i < n; i++) {
		dp[i] = -INF;
	}
	dp[n] = 0;
}
int main() {
	setvbuf(stdout,NULL,_IONBF,0);
	int n;
	while (scanf(" %d", &n) == 1) {
		init(n);
		memset(d,-1,sizeof(d));
		for (int i = 0; i < n; i++) {
			scanf(" %d %d", &d[i].x, &d[i].y);
		}
		sort(d, d + n);
		for (int i = 0, j = n - 1; i < n&&d[i].y>=0; i++) {
//			if (d[i].x + d[i].y >= n) {
//				continue;
//			}
			while (j > d[i].y) {
				dp[j] = max(dp[j],dp[j+1]);
//				printf("j:%d\n",j);
//				dp[j]=dp[j+1];
				j--;
			}
			int k = 1;
			while (d[i] == d[i + 1] && i < n - 1) {
				k++;
				i++;
			}
			for (int e = 1; e + j <= n && e <= k&&e<=n-d[i].x-d[i].y; e++) {
				//printf("%d %d\n",j,j+e);
				dp[j] = max(dp[j + e]+e, dp[j]);
			}
//			printf("(%d,%d)---",d[i].x,d[i].y);
//			printf("(%d,%d)  (%d,%d)\n",d[i].x,d[i].y,d[i+1].x,d[i+1].y);
//			printf("dp[%d]:%d\n",j,dp[j]);
//			if(d[i].y != d[i+1].y){
//				printf("(%d,%d)  (%d,%d)\n",d[i].x,d[i].y,d[i+1].x,d[i+1].y);
//				j --;
//			}

		}
		int ans = 0;
		for (int i = 0; i <= n; i++) {
//			printf("dp[%d]:%d\n",i,dp[i]);
			ans = max(ans, dp[i]);
		}
		printf("%d\n", ans);
	}
	return 0;
}
/*
 5
 4 0
 3 1
 2 2
 3 1
 4 0
 5
 4 0
 3 1
 2 2
 1 3
 0 4
 5
 0 4
 1 3
 2 0
 2 0
 2 0
 5
 0 4
 1 0
 1 0
 1 0
 1 0
 5
 0 4
 1 1
 1 1
 1 1
 4 0
 5
 0 1
 1 1
 1 1
 1 1
 4 0
 5
 0 4
 1 3
 2 0
 2 1
 2 0
3
0 0
0 0
0 0
 */

Compiler output:
main.c:2:9: fatal error: algorithm: No such file or directory
    2 | #include<algorithm>
      |         ^~~~~~~~~~~
compilation terminated.
Language: C

#include <iostream>
#include <stdio.h>
#include <string.h>
#include <algorithm>
#define N 510
using namespace std;
int n;
int dp[N];
struct nd
{
    int a,b;
    int v;
    bool operator == (const nd &p) const
    {
        return a==p.a&&b==p.b;
    }
}nod[N];
bool cmp(nd a,nd b)
{
    if(a.b!=b.b)
    return a.b<b.b;
    return a.a>b.a;
}
int main()
{
    //freopen("in","r",stdin);
    while(scanf("%d",&n)!=EOF)
    {
        int cp=0;
        for(int i=1;i<=n;i++)
        {
            int p,q;
            scanf("%d%d",&p,&q);
            if(p+q+1>n)continue;
            nod[cp].a=p+1;
            nod[cp].b=n-q;
            nod[cp++].v=0;
        }
        sort(nod,nod+cp,cmp);
        int yu=unique(nod,nod+cp)-nod;
        for(int i=0;i<yu;i++)
        {
            int cnt=0;
            for(int j=0;j<cp;j++) cnt+=nod[i]==nod[j];
            nod[i].v=cnt;
        }

        memset(dp,0,sizeof(dp));
        for(int i=0;i<=n;i++)
        {
            for(int j=yu-1;j>=0;j--)
            {
                if(nod[j].b<=i)
                {
                    dp[i]=max(dp[i],dp[nod[j].a-1]+nod[j].v);
                }
            }
        }
        printf("%d\n",dp[n]);
    }
    return 0;
}

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

#include <iostream>
#include <algorithm>
#include <cstdio>
#include <string.h>
#include <vector>
#include <map>
using namespace std;

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

const int V = 100000;
int a[V];

struct Node {
    int ugly;
    char direct;
    int next;
};
Node data[100][2];
int main() {
    //freopen("beavers.in","r",stdin);
    //freopen("beavers.out","w",stdout);
    char str[100];
    for (int i = 0; i < 5; ++i) {
        for (int j = 0; j < 2; ++j) {
            scanf("%s",str);
            data[i][j].ugly = (str[0] == '1');
            data[i][j].direct = str[1];
            data[i][j].next = str[2]-'A';
            
            //printf("data[%d][%d] = %d %c %d\n",i,j,data[i][j].ugly, data[i][j].direct, data[i][j].next);
        }
    }
    for (int i = 0; i < V; ++i) a[i] = 0;
    
    const int zero = V / 2;
    int pos = zero, state = 0;
    bool find = false;
    for (int run = 0; run < 10000; ++run) {
        if (state >= 5) {
            find = true;
            break;
        }
        const Node& v = data[state][a[pos]];
        //printf("run[%d] = %d %c %d\n",run, pos-zero, state+'A', a[pos]);
        state = v.next;
        a[pos] = v.ugly;
        
        pos = (v.direct == 'R')? pos+1 : pos-1;
    }
    if (find) 
        puts("happy beaver");
    else
        puts("unhappy beaver");
}

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

#include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <algorithm>
#include <sstream>
#include <cmath>
#include <climits>

#define clr(x) memset ( (x) , 0 , sizeof ( x ) )
#define Mp make_pair
#define Pb push_back

using namespace std ;

typedef long long LL ;
typedef pair<int,int> Pr ;

const double eps = 1e-6 ;
const int Inf = INT_MAX ;

const int N = 400005 ;
const int M = 400000 ;

int q[N] , a[N] , vis[N] ;
int cases , n , m , num ;
LL sum[N] ;
vector<int> vec ;

void init() {
	vec.clear() ;
	clr ( q ) , clr ( a ) , clr ( vis ) ;
	num = 0 ;
}

LL calc ( int x , int y , int t ) {
	if ( t > y || t < x ) return 0 ;
	LL res = 0 ;
	int l = x / t * t ;
	if ( l < x ) l += t ;
	int r = y / t * t ;
	if ( r > y ) r -= t ;
	if ( l <= r ) {
		int num = ( r - l ) / t + 1 ;
		res += (LL)( l + r ) * num / 2 ;
	}
	return res ;
}

LL dfs ( int u , int num , vector<int>& vec , int x , int y , int cur , int sum ) {
	if ( u >= vec.size() ) {
		if ( num == cur ) return calc ( x , y , sum ) ;
		return 0 ;
	}
	if ( num == cur ) return 0 ;
	return dfs ( u + 1 , num , vec , x , y , cur , sum ) + dfs ( u + 1 , num , vec , x , y , cur + 1 , sum * vec[u] ) ;
}

bool check ( int x , vector<int>& vec ) {
	for ( int i = 0 ; i < vec.size() ; ++i ) {
		if ( x % vec[i] == 0 ) return 0 ;
	}
	return 1 ;
}

LL solve ( int x , int y , int z , int cur ) {
	vec.clear() ;
	int t = z ;
	for ( int i = 2 ; i * i <= t ; ++i )
		if ( t % i == 0 ) {
			vec.Pb ( i ) ;
			while ( t % i == 0 ) t /= i ;
		}
	if ( t > 1 ) vec.Pb ( t ) ;
	int l , r ;
	LL res = 0 ;
	for ( int i = 0 ; i < vec.size() ; ++i ) {
		res += calc ( x , y , vec[i] ) ;
	}
	res = (LL)( x + y ) * ( y - x + 1 ) / 2 - res ;
	int sgn = 1 ;
	for ( int i = 2 ; i <= vec.size() ; ++i ) {
		res += sgn * dfs ( 0 , i , vec , x , y , 0 , 1 ) ; 
		sgn *= -1 ;
	}
	for ( int i = 1 ; i < cur ; ++i )
		if ( q[i] > 0 && vis[ q[i] ] == i ) {
			if ( check ( q[i] , vec ) ) res -= q[i] ;
			if ( check ( a[ q[i] ] , vec ) ) res += a[ q[i] ] ;
			// res = res - q[i] + a[ q[i] ] ;
		}
	return res ;
}

int main() {
	freopen ( "input.txt" , "r" , stdin ) ;
	// initSum() ;
	for ( int i = 1 ; i <= M ; ++i ) {
		int j = M / i ;
		sum[i] = (LL)( j + 1 ) * j / 2 * i ;
	}
	scanf ( "%d" , &cases ) ;
	num = 0 ;
	while ( cases -- ) {
		init() ;
		int i , u , x , y , z ;
		scanf ( "%d%d" , &n , &m ) ;
		for ( i = 1 ; i <= n ; ++i ) a[i] = i ;
		for ( i = 1 ; i <= m ; ++i ) {
			scanf ( "%d" , &u ) ;
			if ( u == 1 ) {
				scanf ( "%d%d%d" , &x , &y , &z ) ;
				cout << solve ( x , y , z , i ) << '\n' ;
			}
			else {
				scanf ( "%d%d" , &x , &y ) ;
				q[i] = x ;
				vis[x] = i ;
				a[x] = y ;
			}
		}
	}
	return 0 ;
}

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

#include<cstdio>
#include <cstring>
#include <algorithm>
#include <map>

using namespace std;

struct st
{
    int l,r,num;
    int id;
}q[100010];

int num[200010];
int s[100010];

int T;
int n,m;

map<int,int> hash;
int tot;

int low(int x)
{
    return x&(-x);
}

const int N= 200000;
int arr1[200010];
int arr2[200010];

void add(int arr[],int pos,int v)
{
    for(int i=pos; i<=N; i+=low(i))
        arr[i] += v;
}

int sum(int arr[],int pos)
{
    int ret = 0;
    for(int i=pos; i; i-=low(i) )
        ret += arr[i];
    return ret;
}

bool cmp(const st& a,const st& b)
{
    return a.r < b.r;
}

bool cmp3(const st& a,const st& b)
{
    return a.l < b.l;
}

struct st2
{
    int num,id;
}ans1[100010],ans2[100010];

bool cmp2(const st2& a,const st2& b)
{
    return a.id < b.id;
}

int main()
{
    freopen("in","r",stdin);
    scanf("%d",&T);
    while(T--)
    {
        hash.clear();

        scanf("%d%d",&n,&m);
        for(int i=1; i<=n; i++)
        {
            scanf("%d",&num[i]);
            s[i] = num[i];
        }

        for(int i=1; i<=m; i++)
        {
            q[i].id = i;
            scanf("%d%d",&q[i].l,&q[i].r);
            q[i].l++;
            q[i].r++;
            scanf("%d",&q[i].num);
            num[i+n] = q[i].num;
        }

        sort(num+1,num+1+n+m);
        tot = unique(num+1,num+1+n+m) - (num+1);

        for(int i=1; i<=tot; i++)
            hash.insert( make_pair(num[i],i) );

        for(int i=1; i<=n; i++)
            s[i] = hash[ s[i] ];

        for(int i=1; i<=m; i++)
            q[i].num = hash[ q[i].num ];

        int cur1 = 1,cur2 = 1;
        int c1 = 0,c2 = 0;

        memset(arr1,0,sizeof(arr1));
        sort(q+1,q+1+m,cmp);
        for(int i=1; i<=n; i++)
        {
            int pos = s[i];
            add(arr1,pos, 1);

            while(cur1 <= m && q[cur1].r == i)
            {
                int res = sum(arr1, q[cur1].num);
                ans1[++c1].id = q[cur1].id;
                ans1[c1].num = res;
                cur1++;
            }
        }

        memset(arr2,0,sizeof(arr2));
        sort(q+1,q+1+m,cmp3);
        for(int i=1; i<=n; i++)
        {
            int pos = s[i];
            add(arr2, pos, 1);

            while(cur2 <= m && q[cur2].l-1 == i)
            {
                int res = sum(arr2, q[cur2].num);
                ans2[++c2].id = q[cur2].id;
                ans2[c2].num = res;
                cur2++;
            }
        }

        sort(ans1+1,ans1+1+m,cmp2);
        sort(ans2+1,ans2+1+m,cmp2);
        for(int i=1; i<=m; i++)
            printf("%d\n",ans1[i].num-ans2[i].num);


        //for(int i=1; i<=m; i++)
           // printf("%d\n",ans[i]);

    }

    return 0;
}

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

#include <iostream>
#include <stdio.h>
#include <string.h>
#include <algorithm>
#define N 100100
const int inf=0x3f3f3f3f;
using namespace std;
struct nd
{
    int a,b;
}nod[N],ndd[N];
bool cmp(nd a,nd b)
{
    if(a.b!=b.b)return a.b<b.b;
    return a.a<b.a;
}
int T,tt,n,m;
int main()
{
    //freopen("in","r",stdin);
    tt=0;
    scanf("%d",&T);
    while(T--)
    {
        scanf("%d%d",&n,&m);
        for(int i=0;i<n;i++)
        {
            scanf("%d%d",&nod[i].a,&nod[i].b);
        }
        sort(nod,nod+n,cmp);
        int pos=-1;
        for(int i=0;i<n;i++)
        {
            if(nod[i].b>0)
            {
                pos=i;
                break;
            }
        }
        if(pos<n)
        {
            int ans=0,ans2=0;
            int sa=inf,sb=0;
            for(int i=pos;i<n;i++)
            {
                sa=min(sa,nod[i].a);
                sb+=nod[i].b;
            }
            if(sa<=m)
            {
                ans+=sa;
                ans2+=n-pos;
                int ss=sb-(n-pos)+1;
                ans2+=min(ss,pos);
                int yu=min(pos-ss-1,pos-1);
                for(int i=yu;i>=0;i--)
                {
                    if(ans+nod[i].a<=m)
                    {
                        ans+=nod[i].a;
                        ans2++;
                    }
                    else break;
                }
                printf("Case %d: %d %d\n",++tt,ans2,ans);
            }
            else
            {
                for(int i=0;i<pos;i++)
                {
                    if(ans+nod[i].a<=m)
                    {
                        ans+=nod[i].a;
                        ans2++;
                    }
                    else break;
                }
                printf("Case %d: %d %d\n",++tt,ans2,ans);
            }
        }
        else if(pos==n)
        {
            int ans=0,ans2=0;
            for(int i=0;i<n;i++)
            {
                if(ans+nod[i].a<=m)
                {
                    ans+=nod[i].a;
                    ans2++;
                }
                else break;
            }
            printf("Case %d: %d %d\n",++tt,ans2,ans);
        }
    }
    return 0;
}

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

#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cmath>
#define see(x) cout<<#x<<":"<<x<<endl;
using namespace std;
const int maxn = 100005;
struct Node{
    int a, b;
}p0[maxn],p1[maxn];
bool cmp(Node x, Node y){
    return x.a<y.a;
}
int main(){
    int T, t, i, j, k, n0, n1, n, m;
    int num, cost, num1, cost1;
    int ansn, ansc;
    scanf("%d",&T);
    for(t=1;t<=T;t++){
        scanf("%d%d",&n,&m);
        i = j = 0;
        for(k=0;k<n;k++){
            int aa,bb;
            scanf("%d%d",&aa,&bb);
            if(bb){
                p1[i].a = aa; p1[i].b = bb;
                i++;
            }
            else{
                p0[j].a = aa; p0[j].b = bb;
                j++;
            }
        }
        n0 = j; n1 = i;
        //see(n0) see(n1)
        sort(p0,p0+n0,cmp);
        int tmp = m;
        num1 = cost1 = 0;
        for(i=0;i<n0;i++){
            if(p0[i].a<=tmp){
                num1++;
                cost1 += p0[i].a;
                tmp -= p0[i].a;
            }
            else{
                break;
            }
        }

        sort(p1,p1+n1,cmp);
        int sword = 0;
        num = cost = 0;
        if(p1[0].a<=m){
            cost = p1[0].a;
            m -= p1[0].a;
            for(i=0;i<n1;i++){
                sword += p1[i].b;
                num++;
            }
            sword -= (n1-1);
            for(i=n0-1;sword>0&&i>=0;i--,sword--){
                num++;
            }
            for(j=0;j<=i;j++){
                if(p0[j].a<=m){
                    num++;
                    cost += p0[j].a;
                    m -= p0[j].a;
                }
                else{
                    break;
                }
            }
        }
        if(num>num1){
            ansn = num;ansc = cost;
        }
        else if(num<num1){
            ansn = num1; ansc = cost1;
        }
        else{
            ansn = num; ansc = min(cost,cost1);
        }
        printf("Case %d: %d %d\n",t,ansn,ansc);
    }
    return 0;
}

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

#include <iostream>
#include <stdio.h>
#include <string.h>
#include <algorithm>
#define N 100100
#define ll long long
const ll inf=0x3f3f3f3f3f3f3f3fll;
using namespace std;
struct nd
{
    ll a,b;
}nod[N],ndd[N];
bool cmp(nd a,nd b)
{
    if(a.b!=b.b)return a.b<b.b;
    return a.a<b.a;
}
ll T,tt,n,m;
int main()
{
    freopen("in","r",stdin);
    tt=0;
    scanf("%I64d",&T);
    while(T--)
    {
        //scanf("%I64d%I64d",&n,&m);
        for(ll i=0;i<n;i++)
        {
            scanf("%I64d%I64d",&nod[i].a,&nod[i].b);
        }
        sort(nod,nod+n,cmp);
        ll pos=-1;
        for(ll i=0;i<n;i++)
        {
            if(nod[i].b>0)
            {
                pos=i;
                break;
            }
        }
        if(pos<n)
        {
            ll ans=0,ans2=0;
            ll sa=inf,sb=0;
            for(ll i=pos;i<n;i++)
            {
                sa=min(sa,nod[i].a);
                sb+=nod[i].b;
            }
            if(sa<=m)
            {
                ans+=sa;
                ans2+=n-pos;
                ll ss=sb-(n-pos)+1;
                ans2+=min(ss,pos);
                ll yu=min(pos-ss-1,pos-1);
                for(ll i=yu;i>=0;i--)
                {
                    if(ans+nod[i].a<=m)
                    {
                        ans+=nod[i].a;
                        ans2++;
                    }
                    else break;
                }
                printf("Case %I64d: %I64d %I64d\n",++tt,ans2,ans);
            }
            else
            {
                for(ll i=0;i<pos;i++)
                {
                    if(ans+nod[i].a<=m)
                    {
                        ans+=nod[i].a;
                        ans2++;
                    }
                    else break;
                }
                printf("Case %I64d: %I64d %I64d\n",++tt,ans2,ans);
            }
        }
        else if(pos==n)
        {
            ll ans=0,ans2=0;
            for(ll i=0;i<n;i++)
            {
                if(ans+nod[i].a<=m)
                {
                    ans+=nod[i].a;
                    ans2++;
                }
                else break;
            }
            printf("Case %I64d: %I64d %I64d\n",++tt,ans2,ans);
        }
    }
    return 0;
}

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

#include <stdio.h>
#include <string.h>
#include <algorithm>
#define clr(a,b) memset(a,b,sizeof(a))
using namespace std;

//int t,n,m;
//int a[100010];
//int ti=1;
//int main(){
////    freopen("d:\\in.txt","r",stdin);
//    scanf("%d",&t);
//    while(t--){
//        scanf("%d%d",&n,&m);
//        int mi=1<<30;
//        int j=0;
//        int s=0;
//        int num=0,mm=m;
//        int flag=0;
//        for(int i=0;i<n;i++){
//            int b,c;
//            scanf("%d%d",&b,&c);
//            if(c){
//                s+=c;
//                if(b<mi)mi=b;
//                num++;
//                flag=1;
//            }
//            else a[j++]=b;
//        }
//        printf("Case %d: ",ti++);
//
//        if(flag&&mi<=m){
//            s-=(num-1);
//            m-=mi;
//        }
//        else s=0,num=0;
//
//        sort(a,a+j);
//
//        int tmpn=0,tmpm=mm;
//        for(int i=0;i<j;i++)if(a[i]<=tmpm)tmpm-=a[i],tmpn++;
//
//        num+=min(j,s);
//        j-=s;
//        for(int i=0;i<j;i++)if(a[i]<=m)m-=a[i],num++;
//
//        if(num<tmpn)num=tmpn,m=tmpm;
//        else if(num==tmpn&&m<tmpm)m=tmpm;
//        printf("%d %d\n",num,mm-m);
//    }
//}

int i,j,n,m;
int p[200000],l;

int main(){
//    freopen("d:\\in.txt","r",stdin);
    int T,cas=0;
    scanf("%d",&T);
    while(T--){
        cas++;
        scanf("%d%d",&n,&m);
        l=0;
        int num=0,exp=0,minn=2000000000;
        for(i=1;i<=n;i++){
            int a,b;
            scanf("%d%d",&a,&b);
            if(b!=0){
                num++;
                exp+=b;
                minn=min(minn,a);
            }
            else p[l++]=a;
        }
        sort(p,p+l);
        int x=0,y=m;
        for(i=0;i<l;i++) if(p[i]<=y){y-=p[i];x++;}

        int x2=0,y2=m;
        if(minn<=m){
            x2+=num+min(l,exp-(num-1));
            l-=(exp-(num-1));
            y2-=minn;
            for(i=0;i<l;i++) if(p[i]<=y2){y2-=p[i];x2++;}
        }
        else x2=0,y2=m;

        if(x<x2) x=x2,y=y2;
        else if(x==x2&&y<y2) x=x2,y=y2;
        printf("Case %d: %d %d\n",cas,x,m-y);
    }
    return 0;
}

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

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

struct snode {
    int x;
    double p;
    bool operator<(const snode &rhs) const {
        return x<rhs.x;
    }
}node[1000010];

int N, M;
double cost[1010][1010];
double f[1010][55];

int main() {
    int i, j, k;
    while (cin>>N>>M, N) {
        int cnt = 0;
        for (i = 0; i < N; ++i) {
            scanf("%d", &j);
            while (j--) {
                scanf("%d%lf", &node[cnt].x, &node[cnt].p);
                cnt++;
            }
        }
        sort(node, node+cnt);
        i = j = 0;
        while (++i != cnt) {
            if (node[j].x != node[i].x)
                node[++j] = node[i];
            else
                node[j].p += node[i].p;
        }
        N = j+1;
        /*
        printf("%d\n", N);
        for (i = 0; i < N; ++i)
            printf("%d %f\n", node[i].x, node[i].p);
        */
        for (i = 1; i <= N; ++i) {
            cost[i][i] = 0;
            k = i;
            double lsum, rsum, res;
            lsum = rsum = res = 0;
            for (j = i+1; j <= N; ++j) {
                rsum += node[j-1].p;
                res += node[j-1].p*(node[j-1].x-node[k-1].x);
                while (k<j && 0>(lsum+node[k-1].p-rsum)*(node[k].x-node[k-1].x)) {
                    res += (lsum+node[k-1].p-rsum)*(node[k].x-node[k-1].x);
                    lsum += node[k-1].p;
                    rsum -= node[k].p;
                    k++;
                }
                cost[i][j] = res;
                //printf("%f ", cost[i][j]);
            }
            //puts("");
        }
        //f[0][0] = 0;
        for (i = 1; i <= N; ++i)
            f[i][1] = cost[1][i];
        for (j = 2; j <= M; ++j)
            for (i = j; i <= N; ++i) {
                f[i][j] = 1e9;
                for (k = j-1; k < i; ++k)
                    f[i][j] = min(f[i][j], f[k][j-1]+cost[k+1][i]);
            }
        /*
        for (i = 0; i <= N; ++i) {
            for (j = 0; j <= M; ++j)
                printf("%f ", f[i][j]);
            puts("");
        }
        */
        printf("%.2f\n", f[N][M]);
    }
    return 0;
}

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

#include<stdio.h>
#include<string.h>
#include<algorithm>
#include<map>
#include<queue>
#define ll long long
#define clr(x,y) memset(x,y,sizeof(x))
using namespace std;

const int inf=100000000;
int i,j,n,m,l,k,h;
int g[100][100];
int x1,y1,x2,y2;
int boss[60][60];
bool vis[60][60][1<<5],flag[60][60];
int d[60][60][1<<5],dx[4]={0,0,1,-1},dy[4]={1,-1,0,0};
struct item{
    int x,y,rt,d;
    item(int x,int y,int rt,int d):x(x),y(y),rt(rt),d(d){}
    bool operator<(const item &a)const{
        return d>a.d;
    }
};
std::priority_queue<item> q;
struct cpoint{
    int x,y,l;
    cpoint(int x,int y,int l):x(x),y(y),l(l){}
};
std::queue<cpoint> que;

bool has(int rt,int x){
    return (rt>>x)&1;
}
void bfs(int sx,int sy,int rt,int sl,int w){
    clr(flag,0);
    que.push(cpoint(sx,sy,sl));
    while(!q.empty()){
        int x=que.front().x,y=que.front().y,l=que.front().l;
        que.pop();
        for(int i=0;i<4;i++){
            int nx=x+dx[i],ny=y+dy[i];
            if(nx<0||nx>=n||ny<0||ny>=m) continue;
            if(g[nx][ny]==-1||flag[nx][ny]) continue;
            flag[nx][ny]=1;
            if(g[nx][ny]==0||has(rt,g[nx][ny]-1)){
                que.push(cpoint(nx,ny,l-1));
                if(!vis[nx][ny][rt]&&w+1<d[nx][ny][rt])
                    q.push(item(nx,ny,rt,w+1));
                continue;
            }
            if(boss[nx][ny]!=-1&&!has(rt,boss[nx][ny])){
                int nrt=(rt|(1<<boss[nx][ny]));
                if(!vis[nx][ny][nrt]&&w+1<d[nx][ny][rt]) q.push(item(nx,ny,nrt,w+1));
            }
            else{
                if(!vis[nx][ny][rt]&&w+1<d[nx][ny][rt]) q.push(item(nx,ny,rt,w+1));
            }
        }
    }
}
int dij(){
    while(!q.empty()) q.pop();
    for(i=0;i<n;i++) for(j=0;j<m;j++) for(h=0;h<(1<<k);h++)
        vis[i][j][h]=0,d[i][j][h]=inf;
    vis[x1][y1][0]=1;d[x1][y1][0]=0;
    q.push(item(x1,y1,0,0));
    while(!q.empty()){
        int x=q.top().x,y=q.top().y,rt=q.top().rt;
        vis[x][y][rt]=1;
        if(x==x2&&y==y2) return d[x][y][rt];
        clr(flag,0);
        bfs(x,y,rt,l,d[x][y][rt]);
    }
    return inf;
}
int main(){
    freopen("d:\\in.txt","r",stdin);
    while(scanf("%d%d%d",&n,&m,&l)!=EOF){
        for(i=0;i<n;i++) for(j=0;j<m;j++) scanf("%d",&g[i][j]);
        scanf("%d",&k);
        clr(boss,-1);
        for(i=0;i<k;i++){
            int x,y;
            scanf("%d%d",&x,&y);
            boss[x-1][y-1]=i;
        }
        scanf("%d%d%d%d",&x1,&y1,&x2,&y2);
        x1--;y1--;x2--;y2--;
        int ans=dij();
        if(ans==inf) printf("We need God's help!\n");
        else printf("%d\n",ans);
    }
    return 0;
}

Compiler output:
main.c:3:9: fatal error: algorithm: No such file or directory
    3 | #include<algorithm>
      |         ^~~~~~~~~~~
compilation terminated.
Language: C

/*
HDU 4055
DP
隶セdp[i][j]陦ィ遉コ莉・j蠑?、エ逧?シ碁柄蠎ヲ荳コi逧?賜蛻礼噪謨ー逶ョ縲?
莉主ュ礼ャヲ荳イ逧?錘髱「蛻ー蜑埼擇DP蟆ア蠕怜?遲疲。井コ??
A
G++ 1437ms
*/
#include<stdio.h>
#include<string.h>
#include<algorithm>
#include<iostream>
using namespace std;
const int MAXN=1010;
const int MOD=1000000007;
char str[MAXN];
int dp[MAXN][MAXN];
int main()
{
   // freopen("in.txt","r",stdin);
   // freopen("out.txt","w",stdout);
    while(scanf("%s",&str)!=EOF)
    {
        memset(dp,0,sizeof(dp));
        int n=strlen(str)+1;
        dp[1][1]=1;
        for(int i=2;i<=n;i++)
        {
            char ch=str[n-i];
            if(ch=='?')
            {
                for(int j=1;j<=i-1;j++)
                {
                    dp[i][1]+=dp[i-1][j];
                    dp[i][1]%=MOD;
                }
                for(int j=2;j<=i;j++)
                {
                    dp[i][j]=dp[i][j-1];
                    //dp[i][j]%=MOD;
                }

            }
            else if(ch=='I')
            {
                dp[i][i]=0;
                for(int j=i-1;j>=1;j--)
                {
                    dp[i][j]=dp[i][j+1]+dp[i-1][j];
                    dp[i][j]%=MOD;
                }

            }
            else if(ch=='D')
            {
                dp[i][1]=0;
                for(int j=2;j<=i;j++)
                {
                     dp[i][j]=dp[i][j-1]+dp[i-1][j-1];
                     dp[i][j]%=MOD;
                }
            }
        }
        int ans=0;
        for(int i=1;i<=n;i++)
        {
            ans+=dp[n][i];
            ans%=MOD;
        }
        printf("%d\n",ans);
    }
    return 0;
}

Compiler output:
main.c:11:9: fatal error: algorithm: No such file or directory
   11 | #include<algorithm>
      |         ^~~~~~~~~~~
compilation terminated.
Language: C

#include<stdio.h>
int main()
{
int m,n,l;
l = m*n
for(m=1;m<10;m++)
{
for(n=1;n<10;n++)
{
printf("%dx%d=%d\n",m,n,l);
}
}
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:8: error: expected ';' before 'for'
    5 | l = m*n
      |        ^
      |        ;
    6 | for(m=1;m<10;m++)
      | ~~~
Language: C

#include <iostream>
#include <cmath>

using namespace std;
typedef long long  ll;
ll x,y,ans;
ll _pow(ll k,int r)
{
    ll b=1;
    while(r)
    {
        if(r%2) b=b*k;
        k=k*k;r/=2;
    }
    return b;
}
ll g(ll k,int r)
{
    return k*(_pow(k,r)-1)/(k-1);
}

void cal(ll n,int r,ll low,ll up)
{
    while(low<=up)
    {
        ll mid=(low+up)/2;
        ll tmp=g(mid,r);
        if(tmp<=n)
        {
            low=mid+1;
            if(tmp==n&&ans>mid*r) ans=mid*r,x=r,y=mid;
        }
        else up=mid-1;
    }
}
int main()
{
    int n;
    while(cin>>n)
    {
        ans=n-1;x=1;y=n-1;
        cal(n-1,2,1,111111);cal(n,2,1,111111);
        cal(n-1,3,1,11111);cal(n,3,1,11111);
        cal(n-1,4,1,1111);cal(n,4,1,1111);
        cal(n-1,5,1,300);cal(n,5,1,300);
        for(int r=6;_pow(2,r)<=n;r++)
        {
            ll sum=0;int k=2;
            while(sum<=n)
            {
                if(sum==n&&ans>k*r) ans=k*r,x=r,y=k;
                sum+=_pow(++k,r);
            }
        }
        cout<<x<<' '<<y<<endl;
    }
    return 0;
}

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

#include<iostream>
#include<cstdio>
#include<string.h>
#include<string>
#include<math.h>
#include<algorithm>
using namespace std;
#define inf (1ll<<62)

long long f[42];
void init(){
    f[0]=1;
    for(int i=1;i<=41;i++){
        f[i]=f[i-1]*2;
    }
}

long long qpow(long long x,long long y){
    if(y==0) return 1;
    if(y==1) return y;
    long long res = qpow(x,y/2);
    if(y&1) return res*res*x;
    else return res*res;
}

long long sum1(int R,int k){
    return (qpow(k,R+1)-1)/(k-1);
}

long long sum2(int R,int k){
    return (qpow(k,R+1)-k)/(k-1);
}


int main(){
    long long n;
    init();
    cout << "inf: " << inf << endl;
    while(scanf("%lld",&n)!=-1){
        long long R = 0,k = 0;
        long long res = inf;
        R = 1;
        k = n-1;
        res = n-1;
        cout << "x: " << sum1(3,10) << " y: " << sum2(3,10) << endl;
        for(long long i=2;i<=40;i++){
            long long l = 2;
            long long r = (long long)(pow(1.0*inf,1.0/(i+1)))+1;
            //cout << "i: " << i << endl;
            while(l<r-1){
                long long mid = (l+r)>>1;
                cout << "tmp: " << sum1(i,mid) << endl;
                if(sum1(i,mid)>n) r = mid;
                else l = mid;
            }
            cout << "i: " << i << endl;
            cout << "=r: " << r << endl;
            if(sum1(i,r)==n){
                cout << "R: " << i << " k: " << r << endl;
                if(res>i*r){
                    res = i*r;
                    R = i;
                    k = r;
                }
            }
            l = 2;
            r = (long long) (pow(1.0*inf,1.0/(i+1)))+1;
            while(l<r-1){
                long long mid = (l+r)>>1;
                if(sum2(i,mid)>n) r = mid;
                else l = mid;
            }
            if(sum2(i,r)==n){
                cout << "R2: " << i << " k2: " << r << endl;
                if(res>i*r){
                    res = i*r;
                    R = i;
                    k = r;
                }
            }
        }
        printf("%lld %lld\n",R,k);
    }
    return 0;
}

Compiler output:
main.c:1:9: fatal error: iostream: No such file or directory
    1 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.