题目链接 https://acm.bnu.edu.cn/v3/contest_show.php?cid=8506#problem/A problem description As we know, the NTU Final PK contest usually tends to be pretty hard. Many teams got frustrated when participating NTU Final PK contest. So I decide to make the fi…
题目链接 https://acm.bnu.edu.cn/v3/problem_show.php?pid=52310 problem description Define the depth of a node in a rooted tree by applying the following rules recursively: • The depth of a root node is 0. • The depths of child nodes whose parents are with…
题目链接 把左括号看成A右括号看成B,推一下就行了.好久之前写的,推到最后发现是一个有规律的序列. #include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll n; while(scanf("%lld",&n)!=EOF) { ll cnt=,sum=; ;; i++) { if(sum>=n) break; cnt++; sum=sum+cnt; //…
题目链接 宽搜一下就行. #include <iostream> #include<cstdio> #include<cstring> #include<queue> using namespace std; int n,m; ][]; ][]={,,-,,,,,-}; ][]; bool check(int x,int y) { ||x>=n||y<||y>=m); ); ; } int prx,pry; struct node { in…
题目链接 #include<cstdio> #include<cstring> #include<algorithm> #include<stack> using namespace std; ]; int cal(int x) { int tx=x; ; while(tx) { &&tx%-pre!=-) ; pre = tx%; tx/=; } return x; } int main() { scanf("%d",&…
题目链接 https://acm.bnu.edu.cn/v3/contest_show.php?cid=8504#problem/C 代码如下: #include <iostream> #include <algorithm> #include <stdio.h> #include <cstring> #include <queue> #include <bitset> #include <set> #include &l…
题目链接 https://acm.bnu.edu.cn/v3/problem_show.php?pid=52305 problem  description In ICPCCamp, there are n cities and (n−1) (bidirectional) roads between cities. The i-th road is between the ai-th and bi-th cities. It is guaranteed that cities are conne…
题目链接 水题,算一下就行. #include <bits/stdc++.h> using namespace std; typedef long long ll; ll x[],y[],z[]; double cal(ll x[]) { ll ans1; ]>=x[]&&x[]<=x[]) ans1=; ]<x[]) ans1=(x[]-x[])*(x[]-x[]); ]>x[]) ans1=(x[]-x[])*(x[]-x[]); return an…
题目链接 很久之前写的了,好像是对拍打表过的,推一下就行了. #include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll a,b,c; scanf("%lld%lld%lld",&a,&b,&c); ll ans=c*; &&b>=)||(a>=)) printf(); &&b==) printf(&…
题目链接 题目大意就是这个,先找出下标的循环节,再快速幂对20160519取余就行了. 找出下标循环节: #include <cstdio> #include <iostream> using namespace std; int main() { ,a=,b=; for(;;i++) { int t=b; b=(a+b)%; a=t%; &&b==) { printf("%d\n",i); break; } } ; } AC代码: #inclu…