Solved A Gym 100712A Who Is The Winner Solved B Gym 100712B Rock-Paper-Scissors Solved C Gym 100712C Street Lamps Solved D Gym 100712D Alternating Strings Solved E Gym 100712E Epic Professor Solved F Gym 100712F Travelling Salesman Solved G Gym 10071…
[题目链接] A - Who Is The Winner 模拟. #include <bits/stdc++.h> using namespace std; int T; int n; struct X { string name; int num; int ti; }s[10010]; bool cmp(X&a,X&b){ if(a.num != b.num) return a.num > b.num; return a.ti < b.ti; } int main…
A(By talker): 题意分析:以a(int) op b(int)形式给出两个整数和操作符, 求两个整数是否存在操作符所给定的关系 ,有则输出true,无则输出false: 思路:由于无时间复杂度的限制,做为 签到题怎么快怎么写(比赛时,赛后 可以考虑尽量压缩代码),裸暴 力,if else拉伸判断每一个就 好了..处理起来的难点可能是中间字 符的读入处理,可以用%s读入然 后strcmp判断,反正怎么无 脑怎么写好了 B (By 2981405123): http://www.jians…
A - Coins Time Limit:3000MS     Memory Limit:262144KB     64bit IO Format:%I64d & %I64u Description standard input/output Hasan and Bahosain want to buy a new video game, they want to share the expenses. Hasan has a set of N coins and Bahosain has a…
传送门 Description Hasan and Bahosain want to buy a new video game, they want to share the expenses. Hasan has a set of N coins and Bahosain has a set of M coins. The video game costs W JDs. Find the number of ways in which they can pay exactly W JDs su…
A. My Friend of Misery 计算出答案的上下界即可. 时间复杂度$O(n)$. #include<bits/stdc++.h> using namespace std; const int N=100010; typedef long long LL; int main(){ int _;scanf("%d",&_); while(_--){ int n;scanf("%d",&n); LL cur=0,r=1LL<…
Kuma Rider久违的第二场训练,这场很水,又在vj的榜单上看到第一场的大哥了,2小时ak,大哥牛啤! A.水 #include<cstdio> #include<iostream> #include<algorithm> #include<queue> #include<cstring> #include<string> #include<vector> #include<cmath> #include&…
http://codeforces.com/gym/100676/attachments 题目大意: 有n个城市,有m条路,每条路都有边长,如果某几个城市的路能组成一个环,那么在环中的这些城市就有传送门,能够瞬间抵达对方的城市(即距离为0),否则,就要走这条路,并且经过的路程为这条路的长度. 问,找一个城市作为这些城市的首都 要求:除了首都城市外,其他城市到首都的最大距离最短. 思路: 边双连通缩点以后就是一棵树,找树上的直径,首都一定是直径上的点.(orz,自己明明注意到了一定是直径上面的点,…
题目链接:https://vjudge.net/contest/154238#overview. ABCDE都是水题. F题,一开始分类讨论,结果似乎写挫了,WA了一发.果断换并查集上,A了. G题,状态压缩DP,不难写,但是时限有点紧,读入也比较恶心..值得注意的是计算一个数二进制下有几个1可以用__builtin_popcount(mask):判断a和b在二进制表示下a是不是b的子集可以用(a&b)==a:另外字符串s想移除最后一位可以s.resize(s.size()-1)或者s.eras…
A - Watching TV /* 题意:求出出现次数最多的数字 */ #include <cstdio> #include <algorithm> #include <cstring> using namespace std; int T,n,a[100010]; char s[110]; int main(){ scanf("%d",&T); while(T--){ memset(a, 0, sizeof(a)); scanf(&quo…