Language: C

include<vector>
#include<list>
#include<map>
#include<set>
#include<deque>
#include<queue>
#include<stack>
#include<bitset>
#include<algorithm>
#include<functional>
#include<numeric>
#include<utility>
#include<iostream>
#include<sstream>
#include<iomanip>
#include<cmath>
#include<cstdlib>
#include<cctype>
#include<string>
#include<cstring>
#include<cstdio>
#include<ctime>
#include<climits>
#include<complex>
#include<cassert>
#define mp make_pair
#define pb push_back
#define sz(x) (int)((x).size())
#define all(x) x.begin(),x.end()
#define clr(x) memset((x),0,sizeof(x))
#define rep(i,n) for (i=0;i<n;i++)
#define Rep(i,a,b) for (i=a;i<=b;i++)
#define ff(i,x) for (i=start[x];i!=-1;i=a[i].next)
#define foreach(e,x) for(__typeof(x.begin()) e=x.begin();e!=x.end();++e)
using namespace std;
const double eps=1e-8;
const double pi=acos(-1.0);
int dblcmp(double d){if (fabs(d)<eps)return 0;return d>eps?1:-1;}
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<string> vs;
typedef pair<int,int> pii;
typedef vector<pii> vpi;
int isleap(int y)
{
	return (y%100!=0&&y%4==0||y%100==0);
}
int dd[]={0,31,28,31,30,31,30,31,31,30,31,30,31};
int days(int y,int m,int d)
{
	int rt=0,i;
	for (i=0;i<y;i++)
	{
		rt+=isleap(i)+365;
	}
	for (i=1;i<m;i++)
	{
		rt+=dd[i];
		rt+=isleap(y)&&(i==2);
	}
	rt+=d-1;
	return rt;
}
void nextday(int &y,int &m,int &d)
{
	int dm=dd[m]+(isleap(y)&&(m==2));
	if (d<dm)
	{
		++d;
		return;
	}
	else if (m<12)
	{
		m++;
		d=1;
		return;
	}
	else 
	{
		y++;
		m=d=1;
		return;
	}
}	
bool v[31111];
int c[31111],sc[31111];
int h[31111],sh[31111];
int main()
{
	int i,j,k;
	int o=days(1980,1,1);
	//cout<<days(2020,12,31)-o<<endl;
	int y,m,d;
	while (scanf("%d/%d/%d",&m,&d,&y)!=EOF)
	{
		int d1=days(y,m,d)-o;
		scanf("%d/%d/%d",&m,&d,&y);
		int d2=days(y,m,d)-o;
		int n;
		memset(v,0,sizeof(v));
		scanf("%d",&n);
		while (n--)
		{
			int ya,ma,da;
			int yb,mb,db;
			scanf("%d/%d/%d",&ma,&da,&ya);
			scanf("%d/%d/%d",&mb,&db,&yb);
			int dx=days(ya,ma,da)-o;
			int dy=days(yb,mb,db)-o;
			for (i=dx;i<=dy;i++)v[i]=1;
		}
		//printf("%d %d\n",d1,d2);
		memset(c,0,sizeof(c));
		memset(h,0,sizeof(h));
		for (i=d1;i<d2;i++)
		{
			if (!v[i])c[i]=1;
		}
		sc[0]=c[0];
		for (i=1;i<31111;i++)
		{
			sc[i]=c[i]+sc[i-1];
		}
		for (i=d2;i<31111;i++)
		{
			if (!v[i])h[i]=1;
		}
		sh[0]=h[0];
		for (i=1;i<31111;i++)
		{
			sh[i]=h[i]+sh[i-1];
		}
		int ans;
		for (i=1000;i<=17000;i++)
		{
			int has=0,hf=0;
			/*
			for (j=i+1-1460;j<=i;j++)
			{
				if (v[j])continue;
				if (j<d1)continue;
				if (j>=d1&&j<d2)hf++;
				hf=min(hf,730);
				if (j>=d2)
				{
					has++;
					has+=hf/2;
					hf=0;
				}
			}
			*/
			j=i-1460;
			has=sh[i];
			if (j>=0)has-=sh[j];
			hf=sc[i];
			if (j>=0)hf-=sc[j];
			hf=min(hf,730);
			has+=hf/2;
			if (has>=1095)
			{
				//printf("%d\n",ans);
				ans=i;
				break;
			}
		}
		ans++;
		//printf("%d\n",ans);
		y=1980,m=1,d=1;
		while (ans--)
		{
			nextday(y,m,d);
		}
		printf("%d/%d/%d\n",m,d,y);
	}
	return 0;
}

Compiler output:
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include<vector>
      |        ^
main.c:2:9: fatal error: list: No such file or directory
    2 | #include<list>
      |         ^~~~~~
compilation terminated.