P4379 [USACO18OPEN]Lemonade Line 题目描述 这是农场上一个炎热的夏日,Farmer John要给他的 NN 头奶牛发柠檬汽水了!所有的 NN 头奶牛(方便起见,编号为 1 \dots N1…N )都喜欢柠檬汽水,只是有些喜欢的程度更高一些.具体地说,奶牛 ii 为了获得柠檬汽水最多愿意排在w_iwi 头奶牛之后.现在所有的 NN 头奶牛都在田里,但是只要Farmer John敲响牛铃,这些奶牛就会立刻赶到FJ的柠檬汽水站.她们会在FJ开始分发柠檬汽水之前到达,但…
题面: D. Lemonade Line Input file: standard input Output file: standard output Time limit: 1 second Memory limit: 256 megabytes It's a hot summer day out on the farm, and Farmer John is serving lemonade to his N cows! All N cows (conveniently numbered…
G. Happy Line time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Do you like summer? Residents of Berland do. They especially love eating ice cream in the hot summer. So this summer day a larg…
这次周赛题目拉了CF315和CF349两套题. 因为我代码模板较长,便只放出关键代码部分 #define ll long long #define MMT(s,a) memset(s, a, sizeof s)#define GO(i,a,b) for(int i = (a); i < (b); ++i)#define GOE(i,a,b) for(int i = (a); i <= (b); ++i)#define OG(i,a,b) for(int i = (a); i > (b);…
EXAM-2018-7-24 未完成 [ ] G 签到水题 A J F A:英文字母有2426个 J:注意long long D:Transit Tree Path 我直接套了单源最短路的一个模板,有人用的是DFS,模板第一次用,记得是无向图. #include<bits/stdc++.h> using namespace std; const int maxn=1e5+7; const long long INF=1e17; long long dist[maxn]; #define ll…
[题目描述] There are n coins in a line. Two players take turns to take one or two coins from right side until there are no more coins left. The player who take the last coin wins. Could you please decide the first play will win or lose? 有 n 个硬币排成一条线.两个参赛…
[题目描述] There are n coins with different value in a line. Two players take turns to take one or two coins from left side until there are no more coins left. The player who take the coins with the most value wins. Could you please decide the first play…