![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
codeforces
文章平均质量分 61
进修中的涵涵涵
acm退役选手
acm icpc 金
dota爱好者
展开
-
Codeforces Round #383 (Div. 2) A(快速幂取膜)
题目链接 题意:求1378^n的最后一位。 直接上快速幂模板 因为a^4=(a^2)*(a^2)。所以可得快速幂如果n是偶数先让底数相乘,奇数直接乘到结果上。加快运算速度#include<stdio.h>#include<string.h>int f(int m,int n){ int b=1; while(n>0) { if(n%2==1)原创 2016-12-07 13:46:18 · 307 阅读 · 0 评论 -
Codeforces Round #411 A.Fake NP (思维题)
CodeForces - 805A Fake NP Tavak and Seyyed are good friends. Seyyed is very funny and he told Tavak to solve the following problem instead of longest-path. You are given l and r. For all integers from原创 2017-05-06 18:25:33 · 1041 阅读 · 0 评论 -
Codeforces Round #416 (Div. 2) A. Vladik and Courtesy
A. Vladik and Courtesytime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAt regular competition Vladik and Valera won a原创 2017-05-27 20:27:07 · 612 阅读 · 0 评论 -
Codeforces Round #416 (Div. 2) B. Vladik and Complicated Book
B. Vladik and Complicated Booktime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputVladik had started reading a complicat原创 2017-05-27 20:33:21 · 1145 阅读 · 0 评论 -
Codeforces Round #415 (Div. 2)A. Straight «A» (暴力)
A. Straight «A»time limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputNoora is a student of one famous high school. It's her原创 2017-05-21 16:50:53 · 451 阅读 · 0 评论 -
Codeforces Round #415 (Div. 2)B. Summer sell-off (水题)
B. Summer sell-offtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputSummer holidays! Someone is going on trips, someone原创 2017-05-21 16:59:13 · 837 阅读 · 0 评论 -
Codeforces Round #417 (Div. 2) A. Sagheer and Crossroads(模拟)
A. Sagheer and Crossroadstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputSagheer is walking in the street when he com原创 2017-06-02 15:39:05 · 807 阅读 · 0 评论 -
Codeforces Round #415 (Div. 2)C. Do you want a date? (数学归纳)
C. Do you want a date?time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputLeha decided to move to a quiet town Vičkopoli原创 2017-05-21 17:11:43 · 1244 阅读 · 0 评论 -
Codeforces Round #424 (Div. 2) A. Unimodal Array
A. Unimodal Arraytime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputArray of integers is unimodal, if:it原创 2017-07-17 18:13:54 · 923 阅读 · 0 评论 -
Codeforces Round #424 (Div. 2) B. Keyboard Layouts(字符串处理)
B. Keyboard Layoutstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere are two popular keyboard layouts i原创 2017-07-17 18:18:57 · 545 阅读 · 0 评论 -
Codeforces Round #424 (Div. 2) D. Office Keys(dp)
D. Office Keystime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere are n people and k keys on a straigh原创 2017-07-17 18:32:29 · 423 阅读 · 0 评论 -
Codeforces Round #424 (Div. 2) C. Jury Marks (思维题)
C. Jury Markstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputPolycarp watched TV-show where k jury members原创 2017-07-17 19:12:52 · 371 阅读 · 0 评论 -
codeforces 900D Unusual Sequences (数论)
D. Unusual Sequencestime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputCount the number of distinct sequences原创 2017-12-21 11:35:25 · 738 阅读 · 0 评论 -
codeforces 901B GCD of Polynomials (数论+构造)
B. GCD of Polynomialstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputSuppose you have two polynomials and原创 2017-12-21 11:27:37 · 777 阅读 · 0 评论 -
Codeforces Round #411 B.3-palindrome (构造)
CodeForces - 805B 3-palindromeIn the beginning of the new year Keivan decided to reverse his name. He doesn’t like palindromes, so he changed Naviek to Navick. He is too selfish, so for a given n he原创 2017-05-06 18:29:45 · 1203 阅读 · 0 评论 -
Codeforces Round #411 C.Find Amir (思维题)
Find Amirtime limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output A few years ago Sajjad left his school and register to another one due to security原创 2017-05-06 18:34:19 · 455 阅读 · 0 评论 -
Codeforces Round #411 D. Minimum number of steps (思维题)
D. Minimum number of stepstime limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output We have a string of letters ‘a’ and ‘b’. We want to perform some o原创 2017-05-06 18:40:03 · 484 阅读 · 0 评论 -
Codeforces Round #383 (Div. 2) B(打表)
题目链接 题目意思,有n个数求n个数取两个数有多少个这样的组合抑或值等于k 因为 a^b=k且 a^k=b; 所以我们可以先打出跟k抑或后的结果表,然后通过查表输出答案#include<stdio.h>#include<string.h>#include<map>using namespace std;long long a[200010];long long b[200010];原创 2016-12-07 13:53:31 · 323 阅读 · 0 评论 -
Codeforces Round #383 (Div. 2) C(递归找环求最小公倍数)
题目链接 题目大意:表示意思有点绕,什么owww的,通俗的来讲就是找环,问的是满足x走到y的步数可以让y走到x。 分析 那么如果x走到x是一个偶数n,说明可以用n/2走到y且y不等于x 然后再用n/2步数走到x。这个环的权值就是n/2; 如果n是一个奇数,那么这个环的权值就是n。 然后就是把所有环的权值都找到并且求他们的最小公倍数。就得到答案啦#include<stdio.h>#inc原创 2016-12-07 14:01:34 · 633 阅读 · 0 评论 -
Codeforces Round #382 (Div. 2) D
题意问n块钱最少交多少税收。 交税收的规则是交小于自己的最大因数,可以将自己拆分 很容易想到拆分成尽量少的质数,突然想到有个数论猜想是关于这个的。 没错哥德巴赫猜想。任何大于2的偶数都可以被分为两个质数。大于7的奇数 可以分为3个质数。 哎~~比赛的时候没有特判2结果本来以为前200的第二天看到才3题。 直接上代码:原创 2016-11-28 15:24:07 · 297 阅读 · 0 评论 -
Codeforces Round #382 (Div. 2) C
题意 有n个人进行两两对抗的比赛,问冠军最后最多可以打几场要求对战的人胜场差距不能大于1.我们可以得到战一场至少需要2个人,战两场至少需要3个人。 那么如果需要战三场,就需要一个战胜了两场的和一个战胜了一场的就需要5个人 所以得到了递推式 a[i]=a[i-1]+a[i-2]; 斐波那契;直接上代码原创 2016-11-28 15:14:50 · 280 阅读 · 0 评论 -
Codeforces Round #382 (Div. 2) B
题意给你n个数在其中取n1个和n2个,求他们的平均数之和 贪心思想,取尽量大的数,取尽量少的数,这样平均数就小 所以排序后先取少量再取大量,求平均求和就可以了代码:原创 2016-11-28 15:10:10 · 275 阅读 · 0 评论 -
Codeforces Round #382 (Div. 2) A
题意 一个字符串上有蚂蚱(G)和虫(T),每次G可以移动K格,问能否到达T 直接模拟#include<stdio.h>#include<string.h>int main(){ int n,m; scanf("%d%d",&n,&m); char a[105]; scanf("%s",a); int g,t; for(int i=0;i<n;i原创 2016-11-28 15:06:26 · 318 阅读 · 0 评论 -
Codeforces Round #384 (Div. 2) A Vladik and flights
A. Vladik and flights time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Vladik is a competitive programmer. This year he is going to win the原创 2016-12-15 13:52:37 · 478 阅读 · 0 评论 -
Codeforces Round #384 (Div. 2) B Chloe and the sequence
B. Chloe and the sequence time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Chloe, the same as Vladik, is a competitive programmer. She didn’原创 2016-12-15 13:55:49 · 697 阅读 · 0 评论 -
Codeforces Round #384 (Div. 2) C Vladik and fractions
C. Vladik and fractions time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Vladik and Chloe decided to determine who of them is better at math原创 2016-12-15 13:59:51 · 373 阅读 · 0 评论 -
CodeForces - 785B Anton and Classes (思维题)
题意: 有n节象棋课和m节程序课,分别选一节,要求输出最大时间间隔。 分析: 一共有3种情况 1:象棋课比程序课早 那么取象棋课最早的结束时间,和程序课最晚的开始时间 2:程序课比象棋课早 那么取程序课最早的结束时间,象棋课最晚的开始时间 3:选两节课有冲突 输出0 AC代码#include<stdio.h>#include<string.h>#include<algorith原创 2017-03-17 16:45:34 · 510 阅读 · 0 评论 -
CodeForces - 785C Anton and Fairy Tale (二分查找)
题意:一个谷仓有n个谷物,每天晚上运进来m个谷物,从第一天时每天早上都有相当于天数的鸟吃相当于天数的谷物(第i天就有i只,吃掉i个谷物)。问第几天谷仓会空。 分析: 1:首先如果直接暴力模拟肯定超时。 2:如果m>=n的话那必定是n天发现 3:因为鸟是一个递增数列而且d=1,当第m天后谷物就会减少 所以可以列出方程 m+(ans+1)*(ans)/2>=n;(因为最后一天可能等不到填充谷物原创 2017-03-17 16:53:51 · 571 阅读 · 0 评论 -
Codeforces Round #412 B. T-Shirt Hunt (暴力枚举)
B. T-Shirt Hunttime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputNot so long ago the Codecraft-17 contest was held on Codeforces.原创 2017-05-08 18:09:08 · 981 阅读 · 0 评论 -
Codeforces Round #412 C. Success Rate (二分查找)
C. Success Ratetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are an experienced Codeforces user. Today you fou原创 2017-05-08 18:18:00 · 369 阅读 · 0 评论 -
Codeforces Round #411 E.Ice cream coloring (dfs染色)
E.Ice cream coloringIsart and Modsart were trying to solve an interesting problem when suddenly Kasra arrived. Breathless, he asked: “Can you solve a problem I’m stuck at all day?” We have a tree T wi原创 2017-05-06 18:51:44 · 1445 阅读 · 0 评论 -
Codeforces Round #576 (Div. 2) D (线段树+lazy-tag & 模拟)
D. Welfare Statetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere is a country with n citizens. The i-th of them initially has ai money. ...原创 2019-08-02 10:16:09 · 284 阅读 · 0 评论