
模拟
文章平均质量分 69
elijahqi
这个作者很懒,什么都没留下…
展开
-
YOJ211 严神的机器人 IV
注意细节即可#include<bits/stdc++.h>using namespace std;inline int gcd(int x,int y){ return !y?x:gcd(y,x%y);}int n,a,b;int main(){ scanf("%d%d%d",&n,&a,&b); long long t=(long long)a*b/gcd(a,b); int ans=n-n/a-n/b+2*(n/t); printf("%d\n.原创 2020-06-16 23:57:58 · 276 阅读 · 0 评论 -
2017.10.26模拟 a seal
http://www.elijahqi.win/archives/1387#include<cstdio>#include<algorithm>#define N 110000using namespace std;inline char gc(){ static char now[1<<16],*T,*S; if (T==S){T=...原创 2018-05-19 23:53:28 · 145 阅读 · 0 评论 -
codeforces 276c Little Girl and Maximum Sum
http://www.elijahqi.win/archives/1184 The little girl loves the problems on array queries very much.One day she came across a rather well-known problem: you’ve got an array of n elements (the eleme...原创 2018-05-07 23:43:04 · 312 阅读 · 0 评论 -
codeforces 876B Sorting the Coins
http://www.elijahqi.win/archives/1273 Recently, Dima met with Sasha in a philatelic store, and since then they are collecting coins together. Their favorite occupation is to sort collections of coins...原创 2018-05-14 23:33:18 · 217 阅读 · 0 评论 -
luogu1328 生活大爆炸版石头剪刀布
http://www.elijahqi.win/archives/1284 题目描述石头剪刀布是常见的猜拳游戏:石头胜剪刀,剪刀胜布,布胜石头。如果两个人出拳一样,则不分胜负。在《生活大爆炸》第二季第8 集中出现了一种石头剪刀布的升级版游戏。升级版游戏在传统的石头剪刀布游戏的基础上,增加了两个新手势:斯波克:《星际迷航》主角之一。蜥蜴人:《星际迷航》中的反面角色。这五种手势的...原创 2018-05-14 23:34:09 · 158 阅读 · 0 评论 -
NOIP2017 普及 luogu3955 图书管理员
http://www.elijahqi.win/archives/1533题目背景数据已再次修正(既然你们不要前导0我就去掉了)题目描述图书馆中每本书都有一个图书编码,可以用于快速检索图书,这个图书编码是一个 正整数。 每位借书的读者手中有一个需求码,这个需求码也是一个正整数。如果一本书的图 书编码恰好以读者的需求码结尾,那么这本书就是这位读者所需要的。 小 D 刚刚当上图书馆...原创 2018-05-25 23:57:03 · 243 阅读 · 0 评论 -
noip2017普及 luogu3954 成绩
http://www.elijahqi.win/archives/1531 题目背景数据已修复题目描述牛牛最近学习了C++入门课程,这门课程的总成绩计算方法是:总成绩=作业成绩×20%+小测成绩×30%+期末考试成绩×50%牛牛想知道,这门课程自己最终能得到多少分。输入输出格式输入格式:输入文件只有1行,包含三个非负整数A、B、C,分别表示牛牛的作业成绩、小测成...原创 2018-05-25 23:57:54 · 194 阅读 · 0 评论 -
AGC 008B - Contiguous Repainting
http://www.elijahqi.win/archives/1589 B - Contiguous Repainting Time limit : 2sec / Memory limit : 256MBScore : 400 pointsProblem Statement There are N squares aligned in a row. The i-th square...原创 2018-05-26 23:42:57 · 195 阅读 · 0 评论 -
AGC 008 A - Simple Calculator
http://www.elijahqi.win/archives/1591 Time limit時間制限 : 2sec / Memory limitメモリ制限 : 256MB配点 : 300 点問題文 すぬけ君は電卓を持っています。 この電卓にはディスプレイと 2 個のボタンが付いています。最初、ディスプレイの値は整数 x です。 すぬけ君の目標は、ディスプレイの値を整数 y にす...原创 2018-05-26 23:43:41 · 314 阅读 · 0 评论 -
2017.10.25模拟 c journey
http://www.elijahqi.win/archives/1381 自己写的渣渣代码 只有20分 留作纪念吧#include<cstdio>#include<cstring>#define N 110#define M 110000#define inf 0x3f3f3f3fstruct node{ int st,ed;}data[N]...原创 2018-05-19 23:52:02 · 153 阅读 · 0 评论 -
luogu2668 斗地主
http://www.elijahqi.win/archives/1376 题目描述牛牛最近迷上了一种叫斗地主的扑克游戏。斗地主是一种使用黑桃、红心、梅花、方片的A到K加上大小王的共54张牌来进行的扑克牌游戏。在斗地主中,牌的大小关系根据牌的数码表示如下:3<4<5<6<7<8<9<10#include<cstdio>#includ...原创 2018-05-19 23:51:16 · 207 阅读 · 0 评论 -
luogu2615 神奇的幻方
http://www.elijahqi.win/archives/1374 题目描述幻方是一种很神奇的N*N矩阵:它由数字1,2,3,……,N*N构成,且每行、每列及两条对角线上的数字之和都相同。当N为奇数时,我们可以通过以下方法构建一个幻方:首先将1写在第一行的中间。之后,按如下方式从小到大依次填写每个数K(K=2,3,…,N*N):1.若(K−1)在第一行但不在最后一列,...原创 2018-05-19 23:49:25 · 604 阅读 · 0 评论 -
codeforces 869A The Artful Expedient
http://www.elijahqi.win/archives/1231 Rock… Paper!After Karen have found the deterministic winning (losing?) strategy for rock-paper-scissors, her brother, Koyomi, comes up with a new game as a sub...原创 2018-05-10 06:51:16 · 160 阅读 · 0 评论 -
luogu3932 浮游大陆的68号岛
http://www.elijahqi.win/archives/1328 题目背景大样例下发链接: https://pan.baidu.com/s/1nuVpRS1 密码: sfxg浮游大陆的68号岛,位于浮游大陆的边境地带。平时很少有人造访。岛上被浓厚的森林覆盖。在这座边境地区不起眼的浮游岛上,建立着神秘的”兵器“管理仓库——妖精仓库。 题目描述妖精仓库里生活着黄金妖精...原创 2018-05-16 23:33:45 · 297 阅读 · 0 评论 -
luogu2038 无线网络选址
http://www.elijahqi.win/archives/1340 题目描述随着智能手机的日益普及,人们对无线网的需求日益增大。某城市决定对城市内的公共场所覆盖无线网。假设该城市的布局为由严格平行的129 条东西向街道和129 条南北向街道所形成的网格状,并且相邻的平行街道之间的距离都是恒定值 1 。东西向街道从北到南依次编号为0,1,2…128 , 南北向街道从西到东依次编号为...原创 2018-05-17 23:47:54 · 124 阅读 · 0 评论 -
luogu1155 双栈排序
http://www.elijahqi.win/archives/1145 题目描述Tom最近在研究一个有趣的排序问题。如图所示,通过2个栈S1和S2,Tom希望借助以下4种操作实现将输入序列升序排序。操作a如果输入序列不为空,将第一个元素压入栈S1操作b如果栈S1不为空,将S1栈顶元素弹出至输出序列操作c如果输入序列不为空,将第一个元素压入栈S2操作d如果...原创 2018-05-05 23:47:20 · 175 阅读 · 0 评论 -
codeforces 583b Robot's Task
http://www.elijahqi.win/archives/1240 Robot Doc is located in the hall, with n computers stand in a line, numbered from left to right from 1 to n. Each computer contains exactly one piece of informat...原创 2018-05-13 23:25:37 · 213 阅读 · 0 评论 -
codeforces 872 B. Maximum of Maximums of Minimums
http://www.elijahqi.win/archives/1255 You are given an array a1, a2, …, an consisting of n integers, and an integer k. You have to split the array into exactly k non-empty subsegments. You’ll then co...原创 2018-05-13 23:27:54 · 202 阅读 · 0 评论 -
codeforces 872aSearch for Pretty Integers
http://www.elijahqi.win/archives/1253 You are given two lists of non-zero digits.Let’s call an integer pretty if its (base 10) representation has at least one digit from the first list and at leas...原创 2018-05-13 23:28:23 · 242 阅读 · 0 评论 -
codeforces 876A Trip For Meal
http://www.elijahqi.win/archives/1267 Winnie-the-Pooh likes honey very much! That is why he decided to visit his friends. Winnie has got three best friends: Rabbit, Owl and Eeyore, each of them lives...原创 2018-05-13 23:29:21 · 149 阅读 · 0 评论 -
bzoj 4996 [Usaco2017 Feb]Why Did the Cow Cross the Road II
http://www.elijahqi.win/archives/3217 题目描述The long road through Farmer John’s farm hasNN crosswalks across it, conveniently numbered1 \ldots N1…N (1 \leq N \leq 100,0001≤N≤100,000 ). To...原创 2018-04-25 17:20:18 · 239 阅读 · 0 评论 -
codeforces 543B Destroying Roads
http://www.elijahqi.win/archives/1612 In some country there are exactly n cities and m bidirectional roads connecting the cities. Cities are numbered with integers from 1 to n. If cities a and b are ...原创 2018-05-26 23:44:33 · 295 阅读 · 0 评论 -
2017.11.1模拟 queue
http://www.elijahqi.win/archives/1464#include<cstdio>#include<algorithm>#define N 11000000using namespace std;inline char gc(){ static char now[1<<16],*S,*T; if (T==S){...原创 2018-05-22 23:50:53 · 111 阅读 · 0 评论 -
coeforces 999A Mishka and Contest
http://www.elijahqi.win/archives/3815 题目描述 Mishka started participating in a programming contest. There are n n problems in the contest. Mishka’s problem-solving skill is equal to k k .Mishka arra...原创 2018-06-22 12:20:53 · 408 阅读 · 0 评论 -
codeforces 999B Reversing Encryption
http://www.elijahqi.win/archives/3817 题目描述 A string ss of length nn can be encrypted by the following algorithm:iterate over all divisors of nn in decreasing order (i.e. from nn to ...原创 2018-06-22 12:22:36 · 517 阅读 · 0 评论 -
luogu3952 时间复杂度 NOIP 提高组
http://www.elijahqi.win/archives/1659 题目描述 小明正在学习一种新的编程语言 A++,刚学会循环语句的他激动地写了好多程序并 给出了他自己算出的时间复杂度,可他的编程老师实在不想一个一个检查小明的程序, 于是你的机会来啦!下面请你编写程序来判断小明对他的每个程序给出的时间复杂度是否正确。A++语言的循环结构如下:F i x y 循环体 ...原创 2018-06-15 23:41:15 · 183 阅读 · 0 评论 -
luogu1071 潜伏者
http://www.elijahqi.win/archives/1556 题目描述R 国和 S 国正陷入战火之中,双方都互派间谍,潜入对方内部,伺机行动。历尽艰险后,潜伏于 S 国的 R 国间谍小 C 终于摸清了 S 国军用密码的编码规则:1. S 国军方内部欲发送的原信息经过加密后在网络上发送,原信息的内容与加密后所得的内容均由大写字母‘A’-‘Z’构成(无空格等其他字符)。2...原创 2018-06-10 00:11:23 · 179 阅读 · 0 评论 -
luogu1125 笨小猴
http://www.elijahqi.win/archives/1566 题目描述笨小猴的词汇量很小,所以每次做英语选择题的时候都很头疼。但是他找到了一种方法,经试验证明,用这种方法去选择选项的时候选对的几率非常大!这种方法的具体描述如下:假设maxn是单词中出现次数最多的字母的出现次数,minn是单词中出现次数最少的字母的出现次数,如果maxn-minn是一个质数,那么笨小猴就认为这...原创 2018-06-10 00:12:21 · 185 阅读 · 0 评论 -
codeforces 1003a Polycarp's Pockets
http://www.elijahqi.win/archives/3910 求出现次数最多的数出现几次#include<bits/stdc++.h>using namespace std;inline char gc(){ static char now[1<<16],*S,*T; if (T==S){T=(S=now)+fread(now,1,1...原创 2018-07-04 14:54:29 · 354 阅读 · 0 评论 -
codeforces 1003 Binary String Constructing
http://www.elijahqi.win/archives/3913 我是先构造了 0,1,0,1的情况尝试满足条件 然后再分类讨论的#include<bits/stdc++.h>using namespace std;inline char gc(){ static char now[1<<16],*S,*T; if (T==S){T=(S...原创 2018-07-04 17:57:40 · 327 阅读 · 0 评论 -
codeforces 1003c Intense Heat
http://www.elijahqi.win/archives/3919 暴力枚举枚举长度再枚举区间 枚举区间的时候只需要删除后面的添加前面的即可#include<bits/stdc++.h>using namespace std;inline char gc(){ static char now[1<<16],*S,*T; if (T==S...原创 2018-07-04 23:26:44 · 262 阅读 · 0 评论 -
codeforces 987A Infinity Gauntlet
http://www.elijahqi.win/archives/3555#include<cstdio>int n;char s[100];bool mark[100];int main(){// freopen("a.in","r",stdin); scanf("%d",&n); for (int i=1;i<=n;++i){ ...原创 2018-05-31 18:25:13 · 244 阅读 · 0 评论 -
luogu4711 「化学」相对分子质量
http://www.elijahqi.win/archives/3808 恶心模拟#include<bits/stdc++.h>using namespace std;map<string,double> MM;inline void init(){ string A="H";MM[A]=1; A="C";MM[A]=12; A="N"...原创 2018-06-22 08:58:07 · 706 阅读 · 0 评论 -
hdu6186 CS Course
http://www.elijahqi.win/archives/1473 Problem Description Little A has come to college and majored in Computer and Science.Today he has learned bit-operations in Algorithm Lessons, and he got a pr...原创 2018-05-23 23:24:38 · 164 阅读 · 0 评论 -
codeforces 981 A Antipalindrome
http://www.elijahqi.win/archives/3538 A string is a palindrome if it reads the same from the left to the right and from the right to the left. For example, the strings “kek”, “abacaba”, “r” and “pap...原创 2018-05-28 23:46:36 · 431 阅读 · 0 评论 -
codeforces 989A A Blend of Springtime
http://www.elijahqi.win/archives/3658 题目描述 When the curtains are opened, a canvas unfolds outside. Kanno marvels at all the blonde colours along the riverside — not tangerines, but blossoms instead....原创 2018-06-12 07:45:26 · 334 阅读 · 0 评论 -
codeforces 989B A Tide of Riverscape
http://www.elijahqi.win/archives/3660 题目描述 Walking along a riverside, Mino silently takes a note of something.”Time,” Mino thinks aloud.“What?”“Time and tide wait for no man,” explains Mino. “My...原创 2018-06-12 07:47:13 · 388 阅读 · 0 评论 -
codeforces 989C A Mist of Florescence
http://www.elijahqi.win/archives/3662 题目描述 As the boat drifts down the river, a wood full of blossoms shows up on the riverfront.”I’ve been here once,” Mino exclaims with delight, “it’s breathtakin...原创 2018-06-12 09:11:02 · 385 阅读 · 0 评论 -
bzoj5288 [Hnoi2018]游戏
http://www.elijahqi.win/archives/3676 有的时候随机并不一定不好 看怎么随机 wc吃亏 什么时候可以长记性要不是在弱省早就退役了记忆化一下之前搜索过的一些位置然后每次不断拓展 把整个排列随机几次然后乱搞即可#include<cstdio>#include<cctype>#include<algorithm...原创 2018-06-13 08:56:05 · 240 阅读 · 0 评论 -
luogu1065 作业调度方案
http://www.elijahqi.win/archives/1574 题目描述 我们现在要利用m台机器加工n个工件,每个工件都有m道工序,每道工序都在不同的指定的机器上完成。每个工件的每道工序都有指定的加工时间。 每个工件的每个工序称为一个操作,我们用记号j-k表示一个操作,其中j为1到n中的某个数字,为工件号;k为1到m中的某个数字,为工序号,例如2-4表示第2个工件第4道工序的这...原创 2018-06-13 23:53:26 · 182 阅读 · 0 评论