2020寒假比赛题目
-bibabo-
这个作者很懒,什么都没留下…
展开
-
B - Primes
A prime number is a natural number greater than 1 and has exactly 2 divisors which are 1 and the number itself.You are given a prime number n, find any 2 prime numbers a and b such that a+b=n or stat...原创 2020-04-25 22:29:10 · 277 阅读 · 0 评论 -
E - Substring Reverse
Two strings s and t of the same length are given. Determine whether it is possible to make t from s using exactly one reverse of some its substring.InputThe first line contains the string s, and the...原创 2020-04-07 21:23:04 · 221 阅读 · 0 评论 -
J - Parallelograms
There are n sticks, the i-th of which has length ai. Alex wants to assemble from them as many parallelograms as possible simultaneously, with each stick used at most in one parallelogram. What maximal...原创 2020-04-07 21:12:51 · 171 阅读 · 0 评论 -
J - Convert QWERTY to Dvorak
思路:把两种键盘的符号都存到字符串中,再寻找就可以了,刚开始用c++一直wa,后来改了c就a了。#include<stdio.h>#include<cstring>using namespace std;char mapp;char s1[]= {"-=_+qwertyuiop[]QWERTYUIOP{}asdfghjkl;'ASDFGHJKL:\"zx...原创 2020-03-10 21:08:08 · 191 阅读 · 0 评论 -
H - May Day Holiday
As a university advocating self-learning and work-rest balance, Marjar University has so many days of rest, including holidays and weekends. Each weekend, which consists of Saturday and Sunday, is a r...原创 2020-03-10 20:58:31 · 128 阅读 · 0 评论 -
I - Array Negations
You are given an array a of n integers, and an integer k. You have to make k negation operations such that at each operation you need to choose an element ai from the array and replace it with −ai.Yo...原创 2020-03-08 21:52:38 · 477 阅读 · 0 评论 -
G - Rikka with Parenthesis II
As we know, Rikka is poor at math. Yuta is worrying about this situation, so he gives Rikka some math tasks to practice. There is one of them:Correct parentheses sequences can be defined recursively ...原创 2020-03-07 21:48:36 · 111 阅读 · 0 评论 -
F - Building Numbers
思路:可以进行的操作有两种:1.在自身上+12.自身*2如果x是偶数的话,x/=2,操作数加1,否则x-=1,操作数加1刚开始直接用sum计算,结果超时,然后用数组b,来存放到第i个数字时候的总操作数,用b[r]-b[l]即所求也不知道为什么,用cin和cout,加上std::ios::sync_with_stdio(false);也不会超时,最后改成了scanf和printf就...原创 2020-02-18 20:24:12 · 169 阅读 · 0 评论 -
H - Eyad and Math
Eyad was given a simple math problem, but since he is very bad at math he asked you to help him.Given 4 numbers, a, b, c, and d. Your task is to find whether ab is less than cd or not.It is guarante...原创 2020-02-18 18:18:15 · 141 阅读 · 0 评论 -
H - 水果
夏天来了好开心啊,呵呵,好多好多水果Joe经营着一个不大的水果店.他认为生存之道就是经营最受顾客欢迎的水果.现在他想要一份水果销售情况的明细表,这样Joe就可以很容易掌握所有水果的销售情况了.Input第一行正整数N(0<N<=10)表示有N组测试数据.每组测试数据的第一行是一个整数M(0<M<=100),表示工有M次成功的交易.其后有M行数据,每行表示一次交易,由...原创 2020-02-16 21:32:30 · 1008 阅读 · 0 评论 -
镜像字符
Let’s call a string “s-palindrome” if it is symmetric about the middle of the string. For example, the string “oHo” is “s-palindrome”, but the string “aa” is not. The string “aa” is not “s-palindrome”...原创 2020-02-12 22:47:30 · 961 阅读 · 0 评论 -
正方形个数
One day Vasya was sitting on a not so interesting Maths lesson and making an origami from a rectangular a mm × b mm sheet of paper (a > b). Usually the first step in making an origami is making a...原创 2020-02-12 18:51:33 · 212 阅读 · 0 评论 -
E - E
Programmer Rostislav got seriously interested in the Link/Cut Tree data structure, which is based on Splay trees. Specifically, he is now studying the expose procedure.Unfortunately, Rostislav is una...原创 2020-02-12 18:28:36 · 138 阅读 · 0 评论 -
第K个数
In late autumn evening n robots gathered in the cheerful company of friends. Each robot has a unique identifier — an integer from 1 to 109.At some moment, robots decided to play the game “Snowball”. ...原创 2020-02-10 20:12:54 · 135 阅读 · 0 评论 -
最小秒数
Luba is surfing the Internet. She currently has n opened tabs in her browser, indexed from 1 to n from left to right. The mouse cursor is currently located at the pos-th tab. Luba needs to use the tab...原创 2020-02-08 18:08:45 · 187 阅读 · 0 评论 -
基因组解码
The process of mammoth’s genome decoding in Berland comes to its end!One of the few remaining tasks is to restore unrecognized nucleotides in a found chain s. Each nucleotide is coded with a capital ...原创 2020-02-07 21:34:29 · 308 阅读 · 0 评论 -
the number of lines (rows) of pixels a and the number of columns of pixels b
A big company decided to launch a new series of rectangular displays, and decided that the display must have exactly n pixels.Your task is to determine the size of the rectangular display — the numbe...原创 2020-02-07 20:28:30 · 483 阅读 · 0 评论 -
雀士分麻将
一年一度的日麻大赛结束啦,作为本场比赛的主裁判汪次郎要给大家发奖品了一姬、二阶堂美树、三上千织等雀士排成一排,等待发奖品。本届比赛的奖品为麻将,发奖规则如下:每个人都有一个自己的分数ai,代表本次比赛中获得的成绩。每个选手至少可以获得1张麻将作为奖励。如果两位选手站位相邻,积分高的选手一定比积分低的选手获得的麻将多。作为主裁判的汪次郎,当然想减少在奖品上的开销,现在他已经知道了每个人的分...原创 2020-02-04 17:57:08 · 229 阅读 · 0 评论 -
单峰的问题
Array of integers is unimodal, if:it is strictly increasing in the beginning;after that it is constant;after that it is strictly decreasing.The first block (increasing) and the last block (decreas...原创 2020-01-29 22:38:18 · 407 阅读 · 0 评论 -
大圆小圆问题
NN is an experienced internet user and that means he spends a lot of time on the social media. Once he found the following image on the Net, which asked him to compare the sizes of inner circles:It ...原创 2020-01-29 22:48:59 · 473 阅读 · 0 评论 -
浴缸
Input file: standard inputOutput file: standard outputTime limit: 1 secondMemory limit: 64 megabytes众所周知龙龙虽然很可爱但其实是俱乐部最强的人。这不他今年去打 EC-Final 辣。处于一些特殊原因,龙龙订了一间主题房,里面有一个大大的浴缸。虽然龙龙很想使用这个浴缸但是傲娇的龙龙打算掩盖自...原创 2020-01-31 20:16:42 · 192 阅读 · 0 评论 -
伙伴系统
思路:慢慢读完题,真的不难#include<bits/stdc++.h>using namespace std;int a[12];//保存内存块,第i个表示2的i次方int b[12];int main(){ std::ios::sync_with_stdio(false); memset(a,0,11); long long int k;...原创 2020-01-31 22:46:35 · 353 阅读 · 0 评论