
入门水题
yjr-1100
( ´・ω・)ノ(._.`),关注我,一起学习
展开
-
Codeforces 583C GCD Tabl
Codeforces 583C GCD Tabl题目The GCD table G of size n × n for an array of positive integers a of length n is defined by formulaLet us remind you that the greatest common divisor (GCD) of two positi...原创 2019-12-05 21:37:14 · 246 阅读 · 1 评论 -
CodeForce 1327B Princesses and Princes (模拟注意时间)
CodeForce 1327B Princesses and Princes初始化也是要时间的,尤其是数组开的大的时候,然后,,我text 6 就 tle 了好久。#include<bits/stdc++.h>#define INF 0x3f3f3f3fusing namespace std;typedef long long ll;const int maxn=...原创 2020-03-25 12:03:47 · 155 阅读 · 0 评论 -
CodeForces - 1325B CopyCopyCopyCopyCopy (排序+unique去重)
CodeForces - 1325B CopyCopyCopyCopyCopy题目分析:这个题就是找 不重复的元素有多少个,排序+去重就好了,这里主要想学一个STL 的去重函数AC代码:#include<iostream>#include<cmath>#include <cstring>#include<stdio.h>#...原创 2020-03-15 16:12:21 · 393 阅读 · 0 评论 -
Codeforce 1324C——Rrog Jumps (思维)
Codeforce 1324C Rrog Jumps题目:题目大意:给你一串由‘R’和’L‘组成的字符串,预先设定好一次可以跳的最远距离d,当跳的地方落在R时只能向右跳,当落的地方在L时只能向左跳,问d最小是多少,题目分析:我们想,青蛙至少要跳出第一步,并且当遇到L的时候就只能后退,如果连续的‘L’就会连续后退,大致思考一下,再大胆猜想一下,d就是找所给字串中最多有多少连续的’...原创 2020-03-13 09:27:50 · 215 阅读 · 0 评论 -
Codeforce 1324A——Yet Another Teteis Problem (思维)
Codeforce 1324A Yet Another Teteis Problem题目:题目大意:这个打比赛的时候,读题很重要啊,,,开始不懂题意,浪费了好长时间,,这个题的大致意思就是,给你一个数组,每个数的值就代表方块的个数,每次下落的方块都是2*1 的样子,和俄罗斯方块的规则一样,那一行填满就可以消去,问你给出的示例能不能消去题目分析:我们想,每次都会下落2*1的方块,对...原创 2020-03-13 08:55:19 · 237 阅读 · 0 评论 -
Codeforce 1312B—— Bogosort 思维
Codeforce 1312B Bogosort题目:You are given an array a1,a2,…,ana1,a2,…,an. Array is good if for each pair of indexes i<j the condition j−aj≠i−ai holds. Can you shuffle this array so that it become...原创 2020-03-10 22:30:04 · 436 阅读 · 0 评论 -
Codeforce1312A --Two Regular Polygons
Codeforce 1312A Two Regular Polygons题目:You are given two integers n and m (m<nm<n). Consider a convex regular polygon of nn vertices. Recall that a regular polygon is a polygon that is equia...原创 2020-03-10 22:21:06 · 231 阅读 · 0 评论 -
CodeForces - 1213C Book Reading (思维 数学)
CodeForces - 1213C Book Reading题目:Polycarp is reading a book consisting of n pages numbered from 1 to n. Every time he finishes the page with the number divisible by m, he writes down the last d...原创 2020-02-09 10:22:52 · 361 阅读 · 0 评论 -
CodeForces - 1213B Bad Prices (思维)
CodeForces - 1213B Bad Prices题目:Polycarp analyzes the prices of the new berPhone. At his disposal are the prices for n last days: a1,a2,…,an, where ai is the price of berPhone on the day i.Pol...原创 2020-02-09 09:26:30 · 406 阅读 · 0 评论 -
CodeForces - 1213A Chips Moving (思维 数学)
CodeForces - 1213A Chips Moving题目:You are given nn chips on a number line. The i-th chip is placed at the integer coordinate xixi. Some chips can have equal coordinates.You can perform each of th...原创 2020-02-09 09:04:52 · 328 阅读 · 0 评论 -
CodeForces - 1215A Yellow Cards (简单模拟)
CodeForces - 1215A Yellow Cards题目:The final match of the Berland Football Cup has been held recently. The referee has shown nn yellow cards throughout the match. At the beginning of the match ther...原创 2020-02-09 08:51:39 · 243 阅读 · 0 评论 -
CodeForces - 1216B Shooting (简单贪心)
CodeForces - 1216B Shooting题目:Recently Vasya decided to improve his pistol shooting skills. Today his coach offered him the following exercise. He placed nn cans in a row on a table. Cans are numb...原创 2020-02-08 21:18:53 · 381 阅读 · 0 评论 -
CodeForces - 1217A Creating a Character (思维 )
CodeForces - 1217A Creating a Character题目:You play your favourite game yet another time. You chose the character you didn’t play before. It has str points of strength and int points of intellig...原创 2020-02-08 17:42:51 · 318 阅读 · 1 评论 -
CodeForces - 1228A Distinct Digits (简单 模拟)
CodeForces - 1228A Distinct Digits题目:You have two integers l and r. Find an integer x which satisfies the conditions below:l≤x≤r.All digits of x are different.If there are multiple answers, p...原创 2020-02-08 16:57:04 · 537 阅读 · 0 评论 -
CodeForces - 1234B2 Social Network (hard version)
CodeForces - 1234B2 Social Network (hard version)题目:The only difference between easy and hard versions are constraints on n and k .You are messaging in one of the popular social networks via you...原创 2020-02-08 15:36:40 · 275 阅读 · 0 评论 -
CodeForces - 1234B1 Social Network (easy version)
CodeForces - 1234B1 Social Network (easy version)题目:The only difference between easy and hard versions are constraints on n and k .You are messaging in one of the popular social networks via you...原创 2020-02-08 15:35:11 · 457 阅读 · 0 评论 -
CodeForces - 1234A Equalize Prices Again
CodeForces - 1234A Equalize Prices Again题目:You are both a shop keeper and a shop assistant at a small nearby shop. You have nn goods, the ii-th good costs aiai coins.You got tired of remembering...原创 2020-02-07 10:18:02 · 200 阅读 · 0 评论 -
CodeForces - 1238A Prime Subtraction (思维 数学)
CodeForces - 1238A Prime Subtraction题目:You are given two integers x and y (it is guaranteed that x>y). You may choose any prime integer pp and subtract it any number of times from xx. Is it pos...原创 2020-02-06 22:03:50 · 344 阅读 · 0 评论 -
CodeForces - 1221B Knights
CodeForces - 1221B 题目:You are given a chess board with n rows and n columns. Initially all cells of the board are empty, and you have to put a white or a black knight into each cell of the board.A...原创 2020-02-01 09:36:13 · 213 阅读 · 0 评论 -
CodeForces - 1221A 2048 Game
CodeForces - 1221A题目:You are playing a variation of game 2048. Initially you have a multiset s of n integers. Every integer in this multiset is a power of twoYou may perform any number (possibly, z...原创 2020-02-01 09:12:46 · 348 阅读 · 0 评论