bryce1010模板 http://codeforces.com/gym/101810 #include<bits/stdc++.h> using namespace std; #define ll long long const ll maxn = 1e5 + 5; const ll mod = 1e9+7; ll n; ll p[maxn]; ll vis[maxn]; int main() { ll t; scanf("%lld",&t); ll pre;…
bryce1010模板 http://codeforces.com/gym/101810 #include <bits/stdc++.h> using namespace std; #define ll long long const int MAXN=1010; int a[MAXN<<1]; int main() { int t; cin>>t; int n; while(t--) { cin>>n; for(int i=1;i<=2*n;i++)…
bryce1010模板 http://codeforces.com/gym/101810 #include<bits/stdc++.h> using namespace std; #define ll long long ll a[1000005]; int main() { int t,n,temp; ll ans,maxn,minl,x; scanf("%d",&t); while(t--) { scanf("%I64d",&n);…
bryce1010模板 http://codeforces.com/gym/101810 #include <bits/stdc++.h> using namespace std; #define ll long long int main() { int t; scanf("%d",&t); ll n,m; while(t--) { scanf("%lld%lld",&n,&m); ll cnt=0; if(m>n)swa…
bryce1010模板 http://codeforces.com/gym/101810 #include <bits/stdc++.h> using namespace std; #define ll long long ll lowbit(ll x) { return x&(-x); } int main() { ll t; cin>>t; ll x; while(t--) { cin>>x; ll res=1; while((x&1)==0) {…
bryce1010模板 http://codeforces.com/gym/101810 #include <bits/stdc++.h> using namespace std; #define ll long long int main() { int T; cin >> T; while (T--) { ll n, x; cin >> x >> n; if (n == 1) { cout << x << endl; contin…
bryce1010模板 http://codeforces.com/gym/101810/problem/A 大模拟,写崩了,代码借队友的...... 注意处理段与段的连接问题: #include<bits/stdc++.h> using namespace std; const int maxn=1e5+5; struct node{ long long l,r,val; node(){} node(long long ll,long long rr,long long vval) { l=…
ACM International Collegiate Programming Contest, Tishreen Collegiate Programming Contest (2018) Syria, Lattakia, Tishreen University, April, 30, 2018 Problem A. Can Shahhoud Solve it? Problem B. Defeat the Monsters Problem C. UCL Game Night Problem…
ACM International Collegiate Programming Contest World Finals 2014 A - Baggage 题目描述:有\(2n\)个字符摆在编号为\(1\)~\(2n\)格子里,奇数位为\(B\),偶数位为\(A\),另外编号为\((-2n+1)\)~\(0\)的格子是空的,现在可以移动两个相邻的字符,移动到两个空的格子里,最终使得全部\(A\)在全部\(B\)的左边,而且字符都是连续的,但不必放回原位,输出最小步数的方案. solution…
ACM International Collegiate Programming Contest World Finals 2013 A - Self-Assembly 题目描述:给出\(n\)个正方形组件,正方形每条边有一个标签,标签可能是00,表示这条边不能与其它边相拼,也可能是一个字母加正号或负号,相同字母不同符号的边可以相拼.每个组件有无限个,问利用这些组件是否能拼出一个无限大的多边形. solution 拆点,每个正方形拆成\(4\)个点,每条边一个,然后每条边拆成两个点(出点和入点)…