April Fools Day Contest 2014
A、C、H三道题目
===================================================================
A. The Great Game
这题怎没看懂。。看了官方题解真是恍然大悟啊,原来是石头剪刀布啊!!!
8< 代表剪刀啊
() 代表石头啊
[] 代表布啊
真是逆天啊,这么一说还真觉得有点像。。。。尤其是那个剪刀。
给那个出题人的想象力跪了。
/*
* =====================================================================================
* Filename : TheGreatGame.cpp
* Description : So Funny
* Version : 0.1
* Created : 04/29/14 07:58
* Author : Liu Xue Yang (LXY), liuxueyang457@163.com
* Motto : How about today?
* =====================================================================================
*/
#include <cstdlib>
#include <cstdio>
#include <cstring>
using namespace std;
/*
* === FUNCTION ======================================================================
* Name: judge
* Description: who win?
* =====================================================================================
*/
int
judge ( char a, char b )
{
if ( a=='[' ) {
if ( b=='[' ) {
;
}
else if ( b=='(' ) {
;
}
else {
;
}
}
if ( a=='(' ) {
if ( b=='[' ) {
;
}
else if ( b=='(' ) {
;
}
else {
;
}
}
' ) {
if ( b=='[' ) {
;
}
else if ( b=='(' ) {
;
}
else {
;
}
}
;
} /* ----- end of function judge ----- */
/*
* === FUNCTION ======================================================================
* Name: main
* =====================================================================================
*/
int
main ( int argc, char *argv[] )
{
], b[];
scanf ( "%s%s", a, b );
, winb = ;
; i < len; i+= ) {
int tmp = judge(a[i], b[i]);
) {
++wina;
}
) {
++winb;
}
}
if ( wina > winb ) {
printf ( "TEAM 1 WINS\n" );
}
else if ( wina < winb ) {
printf ( "TEAM 2 WINS\n" );
}
else {
printf ( "TIE\n" );
}
return EXIT_SUCCESS;
} /* ---------- end of function main ---------- */
看了一下别人的python代码,挺简洁。
#!/bin/python
team1 = input().replace(')
team2 = input().replace(')
s = 0
for i in range(0, len(team1), 2):
if team1[i] > team2[i]:
s += 1
elif team1[i] < team2[i]:
s -= 1
':
s -= 2
':
s += 2
if s > 0:
print("TEAM 1 WINS")
elif s < 0:
print("TEAM 2 WINS")
else:
print("TIE")
这个思路眼前一亮,把对应的字符赋值,比较,然后再修正。
C. Magnum Opus
同样的,开始我也没看懂,没错,是拉丁语。。。
官方题解说Google翻译一下这封信,可以发现这是一封很优美又充满讽刺的信。。
好吧,翻译之后也没看懂。需要注意前面的大写的罗马数字,然后猜想大概和配方的量有关系。
五种配方的量依次是:1 1 2 7 4
所以只需要让五种原料分别除以上面的五个数字,然后找到最小值,输出。
这得需要多丰富的想象力啊!!
#!/bin/python
a, b, c, d, e = list(map(int, input().split(' ')))
result = (int)(min(a/1, b/1, c/2, d/7, e/4))
print(result)
恩,用python写比较简单。
H. A + B Strikes Back
这道题嘛。绝。
官方题解说,提交的前五次系统是不会测试直接给WA!!!
我看到这句话就笑了啊!!!这也太有创意了吧,哈哈哈哈
#!/bin/python
a, b = list(map(int, input().split(' ')))
print(a+b)
不愧是April Fool's Day,题目真有意思。。
April Fools Day Contest 2014的更多相关文章
- April Fools Day Contest 2014 H. A + B Strikes Back
H. A + B Strikes Back time limit per test 1 second memory limit per test 256 megabytes input standar ...
- 坑爹CF April Fools Day Contest题解
H - A + B Strikes Back A + B is often used as an example of the easiest problem possible to show som ...
- April Fools Day Contest 2016 D. Rosetta Problem
D. Rosetta Problem 题目连接: http://www.codeforces.com/contest/656/problem/D Description ++++++++[>+& ...
- April Fools Day Contest 2016 G. You're a Professional
G. You're a Professional 题目连接: http://www.codeforces.com/contest/656/problem/G Description A simple ...
- April Fools Day Contest 2016 F. Ace It!
F. Ace It! 题目连接: http://www.codeforces.com/contest/656/problem/F Description Input The only line of ...
- April Fools Day Contest 2016 E. Out of Controls
E. Out of Controls 题目连接: http://www.codeforces.com/contest/656/problem/E Description You are given a ...
- April Fools Day Contest 2016 C. Without Text 信号与系统
C. Without Text 题目连接: http://www.codeforces.com/contest/656/problem/C Description You can preview th ...
- April Fools Day Contest 2016 B. Scrambled
B. Scrambled 题目连接: http://www.codeforces.com/contest/656/problem/B Description Btoh yuo adn yuor roo ...
- April Fools Day Contest 2016 A. Da Vinci Powers
A. Da Vinci Powers 题目连接: http://www.codeforces.com/contest/656/problem/A Description The input conta ...
随机推荐
- eclipse 启动失败(找不到jvm)
今天启动eclipse时提示了一个错误 在网上找到的解决方法是在eclipse的快捷方式中加入Java的JVM的路径,方法如下: 右键eclipse快捷方式 ->属性 在目标中 如果只有 D: ...
- 如何在HTML5 Canvas 里面显示 Font Awesome 图标
Font Awesome 是一套完美的图标字体,主要目的是和 Bootstrap 搭配使用. 提供的CSS 已经可以完美显示这些图标在网页里面.最新的版本4.3 里面,已经提供519 Icon ...
- CPU的大小端模式
不同体系结构的CPU,数据在内存中存放的排列顺序是不一样的. 存储器中对数据的存储是以字节(Byte)为基本单位的,因此,字(Word)和半字(Half-Word)在存储器中就有两种次序,分别称为:大 ...
- druid.properties的配置
driverClassName=com.mysql.jdbc.Driver url=jdbc:mysql://NoOne:3306/eyes<!--需修改--> username=root ...
- c# UrlEncode,UrlDecode
用 C# winform 处理 utf-8,gb2312编码转换方法 首先,在项目属性 的 应用程序——目标框架中,选择 .NET Framework 4 然后再添加引用——.NET 中选择 ...
- hibernate开发(2)
1 hibernate 的缓存机制 在程序运行中,hibernate要不断访问物理数据库,为了降低访问频率,提升性能,会复制一部分数据到缓存中,使得hibernate可以从缓存中读写数据,然后在特定时 ...
- Android 6.0 新特性
首先谈一谈Android 6.0的一些新特性 锁屏下语音搜索 指纹识别 更完整的应用权限管理 Doze电量管理 Now onTap App link 在开发过程中与我们关系最密切的就是"更完 ...
- Dotspatial 创建面状图层
using DotSpatial.Controls;using DotSpatial.Data;using DotSpatial.Data.Forms;using DotSpatial.Plugins ...
- JS 4 新特性:混合属性(mixins)之二
Mixins many classes[混合许多个类] 迄今为止,我们已经学会了简单的继承,我们还能够通过使用mixins处理机制来混合许多类.源于这种理念是非常简单的:我们能够把许多个类最终混合到一 ...
- Android — — —动态添加碎片
<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android=" ...