A. Die Roll 题目连接: http://www.codeforces.com/contest/9/problem/A Description Yakko, Wakko and Dot, world-famous animaniacs, decided to rest from acting in cartoons, and take a leave to travel a bit. Yakko dreamt to go to Pennsylvania, his Motherland a…
B. Running Student 题目连接: http://www.codeforces.com/contest/9/problem/B Description And again a misfortune fell on Poor Student. He is being late for an exam. Having rushed to a bus stop that is in point (0, 0), he got on a minibus and they drove alon…
A. Chat Server's Outgoing Traffic 题目连接: http://www.codeforces.com/contest/5/problem/A Description Polycarp is working on a new project called "Polychat". Following modern tendencies in IT, he decided, that this project should contain chat as wel…
A. Shortest path of the king 题目连接: http://www.codeforces.com/contest/3/problem/A Description The king is left alone on the chessboard. In spite of this loneliness, he doesn't lose heart, because he has business of national importance. For example, he…
Codeforces Beta Round #80 (Div. 2 Only) A Blackjack1 题意 一共52张扑克,A代表1或者11,2-10表示自己的数字,其他都表示10 现在你已经有一个queen了,问你有多少种方案,能够得到n点 题解 其实只用考虑三种情况,都考虑一下就好了,实在不行就暴力枚举-- 代码 #include<bits/stdc++.h> using namespace std; int n; int main() { scanf("%d",&…
Codeforces Beta Round #83 (Div. 1 Only) A. Dorm Water Supply 题意 给你一个n点m边的图,保证每个点的入度和出度最多为1 如果这个点入度为0,那么这个点就是水龙头点. 如果这个点的出度为0,那么这个点就是储存点. 现在让你把所有水龙头到储存点的路径都输出出来,且输出这条路径的边权最小值 题解 显然是个仙人掌图,所以直接XJB暴力就好了 代码 #include<bits/stdc++.h> using namespace std; co…
Codeforces Beta Round #79 (Div. 2 Only) http://codeforces.com/contest/102 A #include<bits/stdc++.h> using namespace std; #define lson l,mid,rt<<1 #define rson mid+1,r,rt<<1|1 #define sqr(x) ((x)*(x)) #define pb push_back #define eb empla…
Codeforces Beta Round #77 (Div. 2 Only) http://codeforces.com/contest/96 A #include<bits/stdc++.h> using namespace std; #define lson l,mid,rt<<1 #define rson mid+1,r,rt<<1|1 #define sqr(x) ((x)*(x)) #define pb push_back #define eb emplac…
Codeforces Beta Round #76 (Div. 2 Only) http://codeforces.com/contest/94 A #include<bits/stdc++.h> using namespace std; #define lson l,mid,rt<<1 #define rson mid+1,r,rt<<1|1 #define sqr(x) ((x)*(x)) #define pb push_back #define eb emplac…
Codeforces Beta Round #75 (Div. 2 Only) http://codeforces.com/contest/92 A #include<iostream> using namespace std; #define lson l,mid,rt<<1 #define rson mid+1,r,rt<<1|1 #define sqr(x) ((x)*(x)) #define maxn 100005 typedef long long ll; t…