CodeForces - 767A Snacktower】的更多相关文章

A. Snacktower time limit per test:2 seconds memory limit per test:256 megabytes input:standard input output:standard output According to an old legeng, a long time ago Ankh-Morpork residents did something wrong to miss Fortune, and she cursed them. S…
题目大意 一个数可以被输出当且仅当所有比它大的数都已经输出.输入一个1~n的排列,求每次输出的输出序列. 题解 直接用堆模拟 #include <queue> #include <cstdio> #include <cstring> #include <algorithm> using namespace std; typedef long long ll; inline void read(int &x){ x=0;char ch;bool fla…
[题目链接]:http://codeforces.com/contest/767/problem/A [题意] 每天掉一个盘子下来;盘子有大小从1..n依次增大n个盘子; 然后让你叠盘子; 最底层为n,倒数第二层为n-1-.最上层为1; 让你输出每天叠了哪些盘子; [题解] 因为是要连续叠在一起的; 所以每一天其实都有一个固定要等待的盘子; 如果等到了那个盘子; 就一直往下走;输出连续的盘子; 没有的话,它就是下一个需要等待的盘子了; [完整代码] #include <bits/stdc++.h…
A. Snacktower time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output According to an old legeng, a long time ago Ankh-Morpork residents did something wrong to miss Fortune, and she cursed them. S…
A. Snacktower 题目连接: http://codeforces.com/contest/767/problem/A Description According to an old legeng, a long time ago Ankh-Morpork residents did something wrong to miss Fortune, and she cursed them. She said that at some time n snacks of distinct s…
题意不复述. 用个bool数组记录一下,如果某一天,当前剩下的最大的出现了的话,就输出一段. #include<cstdio> using namespace std; int n; bool vis[100010]; int main() { // freopen("a.in","r",stdin); scanf("%d",&n); int x; int now=n; for(int i=1;i<=n;++i) { s…
Codeforces Round #398 (Div. 2) A.Snacktower 模拟 我和官方题解的命名神相似...$has$ #include <iostream> #include <cstdio> #include <algorithm> #include <cstring> #include <cmath> using namespace std; typedef long long ll; ; inline int read()…
上一次我们拿学校的URP做了个小小的demo.... 其实我们还可以把每个学生的证件照爬下来做成一个证件照校花校草评比 另外也可以写一个物理实验自动选课... 但是出于多种原因,,还是绕开这些敏感话题.. 今天,我们来扒一下cf的题面! PS:本代码不是我原创 1. 必要的分析 1.1 页面的获取 一般情况CF的每一个 contest 是这样的: 对应的URL是:http://codeforces.com/contest/xxx 还有一个Complete problemset页面,它是这样的:…
http://codeforces.com/contest/738/problem/D Galya is playing one-dimensional Sea Battle on a 1 × n grid. In this game a ships are placed on the grid. Each of the ships consists of bconsecutive cells. No cell can be part of two ships, however, the shi…
http://codeforces.com/contest/738/problem/C Vasya is currently at a car rental service, and he wants to reach cinema. The film he has bought a ticket for starts in t minutes. There is a straight road of length s from the service to the cinema. Let's…