首页 > [USACO 2009 Ope S]Cow Line
头像 威风镰鼬
发表于 2021-06-30 15:58:47
思路 可以使用vector,也可以使用双向队列(deque)去做,幸好数据能过D操作,不然就要手打了。 代码 #include<bits/stdc++.h> #define int ll using namespace std; typedef long long ll; deque&l 展开全文
头像 savage
发表于 2019-08-19 14:36:18
题目描述 Farmer John's N cows (conveniently numbered 1..N) are forming a line. The line begins with no cows and then, as time progresses, one by one, the 展开全文
头像 savage
发表于 2019-08-16 15:35:21
题目描述 Farmer John's N cows (conveniently numbered 1..N) are forming a line. The line begins with no cows and then, as time progresses, one by one, the 展开全文
头像 A_normal_man
发表于 2022-07-18 19:48:37
这是到典型的双端队列题,运用模拟思想将牛队列看作是双端队列即可。 int times; cin>>times; deque<int> cows; int ncow=1; char order; char side; while 展开全文

等你来战

查看全部