版本比较
题解 P7075 【儒略日】
正文
增加 5 行删除 5 行
32 行未改动333435363737383940418 行未改动50515253545455565758596061626363646566676869707172727374757611 行未改动8889909192929394959618 行未改动32 行未改动
```cpp#include<bits/stdc++.h>#define ll long long#define int long long //重要 #define int long long //重要#define gc getcharusing namespace std;inline ll read(){ ll x=0,f=1;char ch=gc();8 行未改动}q[1010101];struct QWQ{ int y,m,d;}ori,tmp,ans[101010],X[300001];int Q,mx,cnt; int Q,mx,cnt;inline bool cmp(que a,que b){return a.t<b.t;}inline int mabs(int x){return (x>0?x:-x);}inline bool isr(QWQ a){ if (a.y<0) return (-a.y-1)%4==0; if (a.y>=1582) return a.y%400==0||(a.y%4==0&&a.y%100); if (a.y%4==0) return 1; return 0;}inline QWQ nextday(QWQ a){ //分类讨论 inline QWQ nextday(QWQ a){ //分类讨论 QWQ ans=a; if (a.y==1582){ if (a.m==12&&a.d==31) ans.y++,ans.d=1,ans.m=1; else if (a.m==10&&a.d==4) ans.d=15; else if (a.d==mon[a.m]) ans.d=1,ans.m++; else ans.d++; return ans; } if (a.y==-1&&a.m==12&&a.d==31) ans.y=1,ans.d=1,ans.m=1; if (a.y==-1&&a.m==12&&a.d==31) ans.y=1,ans.d=1,ans.m=1; else if (isr(a)){ if (a.m==12&&a.d==31) ans.y++,ans.d=1,ans.m=1; else if (a.d==rmon[a.m]) ans.d=1,ans.m++; else ans.d++;11 行未改动 sort(q+1,q+1+Q,cmp); tmp=ori; for (int i=1;i<=Q;i++){ if (q[i].t>=2451545) break; mx=i; mx=i; } for (int i=1,now=0;i<=mx;i++){ for (;now!=q[i].t;now++) tmp=nextday(tmp); ans[q[i].id]=tmp;18 行未改动