<>第一题

<>题意

<>分析

<>代码
#include <cstdio> #include <iostream> using namespace std; int x, h, m, n, t;
int main() { scanf("%d",&x); scanf("%d:%d",&h,&m); scanf("%d",&n); t=h*60+m; t-=
n; while (t<0) { t+=1440; x--; if (x==0) x=7; } printf("%d\n",x); h=t/60; m=t%60
; if (h<10) printf("0%d:",h); else printf("%d:",h); if (m<10) printf("0%d\n",m);
else printf("%d\n",m); return 0; }
<>第二题

<>题意

<>分析

#include <cstdio> #include <iostream> #include <map> using namespace std; int n
, ans=0; int a[100005]; int b[100005]; map<int, int> st; map<int, int> en; int
main() { scanf("%d",&n); for (int i=1; i<=n; ++i) { scanf("%d",&a[i]); st[a[i]]
= i; } for (int i=1; i<=n; ++i) { scanf("%d",&b[i]); en[b[i]] = i; } for (int i=
1; i<=n; ++i) { for (int j=1; j<=n; ++j) { if (i==j) continue; if (st[i] > st[j]
&& en[i] < en[j]) { ans++; break; } } } printf("%d\n",ans); return 0; }
<>第3题

<>题意

2+...+x/km>=n。

<>分析

<>代码
#include <cstdio> #include <iostream> typedef long long ll; using namespace std
; ll n, k; bool judge(ll x) { ll t=1, s=0; while(x/t) { s+=x/t; t*=k; } return s
>=n; } int main() { scanf("%lld%lld",&n, &k); ll l=1, r=n, m; while(l<r) { m=(l+
r)/2; if (judge(m)) r=m-1; else l=m+1; } while(!judge(l)) l++; printf("%lld\n",l
); return 0; }
<>第四题

<>题意

<>分析

<>代码
#include <cstdio> #include <iostream> #include <cstring> const int MOD = 1e9+7;
using namespace std; int k; int dp[1000005][10]; int main() { memset(dp,0,sizeof
(dp)); scanf("%d",&k); dp[0][0]=1; dp[1][1]=1; dp[1][2]=1; dp[1][3]=1; for (int
i=1; i<=k; ++i) { dp[i][0] = ((dp[i-1][1]%MOD+dp[i-1][2]%MOD)%MOD+dp[i-1][3]%MOD
)%MOD; dp[i][1] = ((dp[i-1][0]%MOD+dp[i-1][2]%MOD)%MOD+dp[i-1][3]%MOD)%MOD; dp[i
][2] = ((dp[i-1][0]%MOD+dp[i-1][1]%MOD)%MOD+dp[i-1][3]%MOD)%MOD; dp[i][3] = ((dp
[i-1][0]%MOD+dp[i-1][1]%MOD)%MOD+dp[i-1][2]%MOD)%MOD; } printf("%d\n",dp[k][0]%
MOD); return 0; }
<>第五题

<>题意

<>分析

emm看起来像AC自动机，奈何我不会，写了个暴力，居然WA了，然后改了改还是WA。。。难道是我题目读错了，后面不太想写了，就结束了。