博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
April Fools Contest 2018
阅读量:6983 次
发布时间:2019-06-27

本文共 3590 字,大约阅读时间需要 11 分钟。

这个比赛不正经,但是我可以一本正经的写代码啊

A. Quirky Quantifiers
time limit per test
2 seconds
memory limit per test
64 megabytes
input
standard input
output
standard output
 
Input

The input contains a single integer a (10 ≤ a ≤ 999).

Output

Output 0 or 1.

Examples
input
Copy
13
output
1
input
Copy
927
output
1
input
Copy
48
output
0

蛇皮,题目什么都没,0和1,反正是A,猜奇偶吧

#include
using namespace std;int main(){ int n; cin>>n; cout<<(n&1); return 0;}
B. A Map of the Cat
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

If you have ever interacted with a cat, you have probably noticed that they are quite particular about how to pet them. Here is an approximate map of a normal cat.

However, some cats won't tolerate this nonsense from the humans. Here is a map of a grumpy cat.

You have met a cat. Can you figure out whether it's normal or grumpy?

Interaction

This is an interactive problem. Initially you're not given any information about the cat. Instead, the cat is divided into ten areas, indexed from 0 to 9.

In one query you can choose which area you'll pet and print the corresponding index to standard out. You will get the cat's response, as depicted on the corresponding map, via standard in. For simplicity all responses are written in lowercase.

Once you're certain what type of cat you're dealing with, output "normal" or "grumpy" to standard out.

Note

Please make sure to use the stream flushing operation after each query in order not to leave part of your output in some buffer.

B就直接阅读理解了么,这个脑洞大,让我组合的应该,不做这个

 

 

C. Ravioli Sort
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

Everybody knows of . You decided to implement an analog sorting algorithm yourself, but as you survey your pantry you realize you're out of spaghetti! The only type of pasta you have is ravioli, but you are not going to let this stop you...

You come up with the following algorithm. For each number in the array ai, build a stack of ai ravioli. The image shows the stack for ai = 4.

Arrange the stacks in one row in the order in which the corresponding numbers appear in the input array. Find the tallest one (if there are several stacks of maximal height, use the leftmost one). Remove it and add its height to the end of the output array. Shift the stacks in the row so that there is no gap between them. Repeat the procedure until all stacks have been removed.

At first you are very happy with your algorithm, but as you try it on more inputs you realize that it doesn't always produce the right sorted array. Turns out when two stacks of ravioli are next to each other (at any step of the process) and differ in height by two or more, the top ravioli of the taller stack slides down on top of the lower stack.

Given an input array, figure out whether the described algorithm will sort it correctly.

Input

The first line of input contains a single number n (1 ≤ n ≤ 10) — the size of the array.

The second line of input contains n space-separated integers ai (1 ≤ ai ≤ 100) — the elements of the array.

Output

Output "YES" if the array can be sorted using the described procedure and "NO" if it can not.

Examples
input
Copy
3 1 2 3
output
YES
input
Copy
3 3 1 2
output
NO
Note

In the second example the array will change even before the tallest stack is chosen for the first time: ravioli from stack of height 3 will slide on the stack of height 1, and the algorithm will output an array {2, 2, 2}.

做nmh,读不懂,我还是补线段树好了

 

 

 

 

转载于:https://www.cnblogs.com/BobHuang/p/8689958.html

你可能感兴趣的文章
Balluff推出刀具识别系统
查看>>
怎么写ERP实施方案?
查看>>
Shadow Brokers扬言兜售新漏洞攻击工具
查看>>
低照度监控前景广阔 企业展开激烈角逐
查看>>
美国支付巨头Verifone遭遇网络攻击
查看>>
开平推进智慧城市等领域信息化建设及公共数据资源共享
查看>>
宜兴电信成功跨界合作开拓农村物联网市场
查看>>
Oracle业务适合用PostgreSQL去O的一些评判标准
查看>>
多个常见代码设计缺陷
查看>>
今年光伏市场规模可达30GW 分布式有望占据三分江山
查看>>
因新漏洞问题 Firefox 49发布时间将延期一周
查看>>
WLAN产品形态之分层架构
查看>>
《敏捷可执行需求说明 Scrum提炼及实现技术》—— 1.2 识别不确定性的影响
查看>>
Chrome 隐藏 SSL 证书信息 禁止禁用 DRM
查看>>
《Windows Server 2012 Hyper-V虚拟化管理实践》——3.2 Hyper-V主机日常管理
查看>>
《C语言编程魔法书:基于C11标准》——第一篇 预备知识篇 第1章 C魔法概览1.1 例说编程语言...
查看>>
《IPv6安全》——1.7 推荐读物和资料
查看>>
《实施Cisco统一通信管理器(CIPT2)》一1.2 概述部署多站点环境时将会遇到的挑战...
查看>>
《Photoshop Lab修色圣典(修订版)》—第1课深入讨论
查看>>
Chromium 操作系统即将支持所有 SBC 单板电脑
查看>>