April Fools Contest 2017 F】的更多相关文章

Description You are developing a new feature for the website which sells airline tickets: being able to sort tickets by price! You have already extracted the tickets' prices, so there's just the last step to be done... You are given an array of integ…
A. Numbers Joke 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 (1 ≤ a ≤ 30). Output Output a single integer. Example Input 3 Output 27 题目链接:ht…
趁着上课无聊,来补一补-- A. Numbers Joke 直接oeis就好了:http://oeis.org/search?q=numbers+joke&language=english&go=Search #include<bits/stdc++.h> using namespace std; long long p[]={ 4, 22, 27, 58, 85, 94, 121, 166, 202, 265, 274, 319, 346, 355, 378, 382, 39…
都是神题,我一题都不会,全程听学长题解打代码,我代码巨丑就不贴了 题解见巨神博客 假装自己没有做过这套…
Description Input The input consists of four lines, each line containing a single digit 0 or 1. Output Output a single digit, 0 or 1. Example input 0110 output 0 一个数字电路,不过或门和异或门是反的,所以..注意下 #include<bits/stdc++.h> using namespace std; #define ll long…
Description Input The only line of the input contains a string of digits. The length of the string is between 1 and 10, inclusive. Output Output "Yes" or "No". Examples input 373 output Yes input 121 output No input 436 output Yes看是不是回…
Description DO YOU EXPECT ME TO FIND THIS OUT? WHAT BASE AND/XOR LANGUAGE INCLUDES string? DON'T BYTE OF MORE THAN YOU CAN CHEW YOU CAN ONLY DISTORT THE LARGEST OF MATHEMATICS SO FAR SAYING "ABRACADABRA" WITHOUT A MAGIC AND WON'T DO YOU ANY GOOD…
Description Programmers' kids solve this riddle in 5-10 minutes. How fast can you do it? Input The input contains a single integer n (0 ≤ n ≤ 2000000000). Output Output a single integer. Examples input 11 output 2 input 14 output 0 input 61441 output…
Description Input The input contains a single integer a (1 ≤ a ≤ 30). Output Output a single integer. Example input 3 output 27 那个,这个,额,查题目名称吧Numbers Joke #include<bits/stdc++.h> using namespace std; #define ll long long ll a[]={,, , , , , , , , , ,…
这个比赛不正经,但是我可以一本正经的写代码啊 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 inp…
H - A + B Strikes Back A + B is often used as an example of the easiest problem possible to show some contest platform. However, some scientists have observed that sometimes this problem is not so easy to get accepted. Want to try? Input The input co…
April Fools Day Contest 2014 A.C.H三道题目 =================================================================== A. The Great Game 这题怎没看懂..看了官方题解真是恍然大悟啊,原来是石头剪刀布啊!!! 8< 代表剪刀啊 () 代表石头啊 [] 代表布啊 真是逆天啊,这么一说还真觉得有点像....尤其是那个剪刀. 给那个出题人的想象力跪了. /* * ===============…
H. A + B Strikes Back time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output A + B is often used as an example of the easiest problem possible to show some contest platform. However, some scientis…
[atcoder contest 010] F - Tree Game Time limit : 2sec / Memory limit : 256MB Score : 1600 points Problem Statement There is a tree with N vertices, numbered 1 through N. The i-th of the N−1 edges connects vertices ai and bi. Currently, there are Ai s…
NAIPC 2017 Yin and Yang Stones 75.39% 1000ms 262144K   A mysterious circular arrangement of black stones and white stones has appeared. Ming has been tasked with balancing the stones so that only one black and one white stone remain. Ming has two ope…
1065 Beihang Collegiate Pronunciation Contest 2017 思路 在字符串中不断做匹配 找到一个匹配就输出 时间复杂度\(O(n)\) ps.模式串是定长的,因此看做常数 代码 #include<string> #include<iostream> using namespace std; int main() { int n; cin >> n; string ch; cin >> ch; for (auto i…
G. Fake News (easy) time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output As it's the first of April, Heidi is suspecting that the news she reads today are fake, and she does not want to look sil…
AtCoder Regular Contest 069 F Flags 二分,2-sat,线段树优化建图 链接 AtCoder 大意 在数轴上放上n个点,点i可能的位置有\(x_i\)或者\(y_i\) 思路 首先最大值最小,考虑二分答案. 如何check呢. 只有两个坐标,考虑2-sat. 可是边有点多,存不下来,考虑线段树优化建图. 如何建图. 先按照做坐标排序,我们有两个点的范围 [id[x]-mid,id[x]+mid],[id[y]-mid,id[y]+mid]. 这个显然是z选了,区…
AtCoder Beginner Contest 137 F 数论鬼题(虽然不算特别数论) 希望你在浏览这篇题解前已经知道了费马小定理 利用用费马小定理构造函数\(g(x)=(x-i)^{P-1}\) \[x=i,g(x)=0\] \[x\ne i ,g(x)=1\] 则我们可以构造 \[f(x)=\sum^{i=0}_{P-1}(-a_i*(x-i)^{P-1}+a_i)\] 对于第\(i\)条式子当且仅当\(a_i=1 \ and \ x=i\)时取到\(1\) 代码写的比较奇怪 const…
ACM International Collegiate Programming Contest, Tishreen Collegiate Programming Contest (2017)- K. Poor Ramzi -dp+记忆化搜索 [Problem Description] 给你一串\(01\)字符串,将其划分,使得划分后,分别求出每组\(01\)之和后是回文的,求划分的方案数, [Solution] 定义\(dp[l][r]\)表示,区间\([l,r]\)中满足条件的方案数是多少.…
F. Ace It! 题目连接: http://www.codeforces.com/contest/656/problem/F Description Input The only line of the input is a string of 7 characters. The first character is letter A, followed by 6 digits. The input is guaranteed to be valid (for certain definit…
G. You're a Professional 题目连接: http://www.codeforces.com/contest/656/problem/G Description A simple recommendation system would recommend a user things liked by a certain number of their friends. In this problem you will implement part of such a syst…
D. Rosetta Problem 题目连接: http://www.codeforces.com/contest/656/problem/D Description ++++++++[>+>++>+++>++++>+++++>++++++>+++++++>++++++++>+++++++++>++++++++++>+ ++++++++++>++++++++++++>+++++++++++++>+++++++++++++…
E. Out of Controls 题目连接: http://www.codeforces.com/contest/656/problem/E Description You are given a complete undirected graph. For each pair of vertices you are given the length of the edge that connects them. Find the shortest paths between each pa…
C. Without Text 题目连接: http://www.codeforces.com/contest/656/problem/C Description You can preview the image in better quality by the link: http://assets.codeforces.com/files/656/without-text.png Input The only line of the input is a string (between 1…
B. Scrambled 题目连接: http://www.codeforces.com/contest/656/problem/B Description Btoh yuo adn yuor roomatme lhoate wianshg disehs, btu stlil sdmoeboy msut peorrfm tihs cohre dialy. Oen dya yuo decdie to idourtcne smoe syestm. Yuor rmmotaoe sstgegus teh…
A. Da Vinci Powers 题目连接: http://www.codeforces.com/contest/656/problem/A Description The input contains a single integer a (0 ≤ a ≤ 35). Input Output a single integer. Output In the first line print "YES" (without quotes), if Polycarpus can perf…
题目连接:http://codeforces.com/problemset/problem/656/E 愚人节专场的E,整个其实就是个Floyd算法,但是要求代码中不能包含 definedoforforeachwhilerepeatuntilifthenelseelifelsifelseifcaseswitch 这些关键词. 如果不考虑屏蔽define,很容易想到将代码中用到的关键词全部define成其它不在列表中的词.但是define的时候还是得要写出原来的关键词,况且define也被屏蔽了,…
A. Thanos Sort time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Thanos sort is a supervillain sorting algorithm, which works as follows: if the array is not sorted, snap your fingers* to rem…
A. Thanos Sort time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Thanos sort is a supervillain sorting algorithm, which works as follows: if the array is not sorted, snap your fingers* to rem…