能把 not working now 写成 not working hard now 还查一晚上也是没谁了 我的做法是维护两个set 分别是前20% 和后80% #include<iostream> #include<algorithm> #include<set> #include<cmath> #include<map> #include<cstdio> using namespace std; #define sz(X) ((i…
能把 not working now 写成 not working hard now 还查一晚上也是没谁了 我的做法是维护两个set 分别是前20% 和后80% #include<iostream> #include<algorithm> #include<set> #include<cmath> #include<map> #include<cstdio> using namespace std; #define sz(X) ((i…
题目链接 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…