12 2017 档案
摘要:D - 2017-like Number Time limit : 2sec / Memory limit : 256MB Score : 400 points Problem Statement We say that a odd number N is similar to 2017 when
阅读全文
摘要:一维差值维护是一种简单的小算法,该算法用一个巧妙地数列机制解决了多次对数列进行数据加减操作的复杂度,这个算法的思维偏向于动态规范。下面我们从一个问题开始入手介绍这个算法: 问题描述: 已知n个数的数列a,有m次操作,每次操作给定l,r,k三个数,使得al到ar内所有数加上k。注意l到r的区间包含al
阅读全文
摘要:题目描述 现在有一个N*M的矩形星图。其中包括恒星和黑洞。恒星可以向上、下、左、右发射光束,且允许光束从其中穿过;黑洞会吸收所有经过的光束。 若一颗恒星向上、下、左、右发射光束,你能告诉我,该光束能否避免被黑洞吸收,进入星图之外的区域么? 输入描述: 单组输入。第一行三个正整数N,M,Q(1 <=
阅读全文
摘要:今天做牛客网西南民大的题遇到了二维前缀和的题目,是个比较经典出过很多次的题目了, 看来光掌握一维前缀和还是远远不够的,二维前缀和也必须很熟练。 前缀和 前缀和可以理解为数学上的数列的前n项和(对于一个一维数组的前缀和)。 我们定义一个数组a的前缀和数组sum[i]=a[1]+a[2]+...+a[i
阅读全文
摘要:%c是在缓冲区内找到一个字符赋值给变量。输入变量时一般用回车来结束也就是“\n”,它也属于一个字符被写入了缓冲区内所以被赋值给变量了,就不用你输入了。 1.可以这样解决 2.或这样
阅读全文
摘要:【题意】: 鲍勃编程一个机器人在2d迷宫中导航。迷宫有一些障碍。空单元格用'。'表示,其中障碍物用'#'表示。迷宫中有一个机器人。它的起始位置用字符“S”表示。这个位置没有任何障碍。迷宫中也有一个出口。它的位置用字符“E”表示。这个位置没有任何障碍。机器人只能向上,向左,向右或向下移动。当鲍勃编程机
阅读全文
摘要:B. Two Cakes time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output B. Two Cakes time limit per
阅读全文
摘要:【题目链接】: Educational Codeforces Round 35 (Rated for Div. 2) A. Nearest Minimums time limit per test 2 seconds memory limit per test 256 megabytes input
阅读全文
摘要:A. Generate Login time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output The preferred way to g
阅读全文
摘要:B. Inventory time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output B. Inventory time limit per
阅读全文
摘要:【题目链接】:http://vj.bit-studio.cn/contest/205664#overview A: 【给你一个长度为n的序列,尾部插入再反转,求n次后最终序列】【规律/思维】 【分析】:STL-deque会超时,只能找规律。 【代码】: #include<bits/stdc++.h>
阅读全文
摘要:C. Shockers time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output C. Shockers time limit per t
阅读全文
摘要:【官方题解】:https://www.nowcoder.com/discuss/65411?toCommentId=1134823 【题目链接】:https://www.nowcoder.com/test/question/8fd2b461f3874031a29bdf5aac3c8d51?pid=8
阅读全文
摘要:http://120.78.162.102/problem.php?cid=1333&pid=0 【问题 A: 4357买糖】【等差数列】 Code: #include <bits/stdc++.h> using namespace std; int main() { int a,b,p,ans;
阅读全文
摘要:【题目链接】:https://vijos.org/p/category/%E5%85%B6%E4%BB%96,%E4%BA%8C%E5%88%86%E6%9F%A5%E6%89%BE 描述 一个快递公司要将n个包裹分别送到n个地方,并分配给邮递员小K一个事先设定好的路线,小K需要开车按照路线给的地点
阅读全文
摘要:1.【数论】给你N,求不大于N的最大完全平方数。 #include<bits/stdc++.h> #define FOR(i,a,b) for(int i=(a),_b=(b);i<=_b;i++) #define DOR(i,a,b) for(int i=(a),_b=(b);i>=_b;i--)
阅读全文
摘要:【题目链接】:https://www.nowcoder.com/acm/contest/63#question 【暴力题】 时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 131072K,其他语言262144K64bit IO Format: %lld 题目描述 栗酱突发闲心,玩了一会
阅读全文
摘要:B. Proper Nutrition time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output B. Proper Nutrition t
阅读全文
摘要:A. Rounding time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Vasya has a non-negative inte
阅读全文
摘要:看到双端队列(deque)了,书上是这样说的:除了栈和队列外还有一种限定性数据结构是双端队列;双端队列是限定插入和删除操作在表的两端进行的线性表;尽管双端队列看起来似乎比栈和队列更灵活,但实际上在应用程序中远不及栈和队列有用,故在此不作详细讨论。于是乎就跳了过去讲链队列和循环队列去了,我想反正是复习
阅读全文
摘要:【题意】:给你一个数k,求所有使得1/k = 1/x + 1/y成立的x≥y的整数对。 【分析】:枚举所有在区间【k+1, 2k】上的 y 即可,当 1/k - 1/y 的结果分子为1即为一组解。 【代码】:
阅读全文
摘要:【题意】:乘积最大的子序列。n∈[1,10],s∈[-10,10] 【代码】:
阅读全文
摘要:【题意】:输入正整数n,用0~9这10个数字不重复组成两个五位数abcde和fghij,使得abcde/fghij的商为n,按顺序输出所有结果。如果没有找到则输出“There are no solutions for N.”。这里2<=n<=79。 【分析】: 1.因为n>=2,且abcde=fgh
阅读全文
摘要:Description A ring is composed of n (even number) circles as shown in diagram. Put natural numbers 1,2,3,...,n into each circle separately, and the su
阅读全文
摘要:题目描述 作为彩虹岛上最擅长打铁的人,𝑛𝑝𝑠今天一共打了𝑛块大小为1的铁。为了保存这些铁块,他打算制作若干个箱子。其中,第1个箱子的容量为1(可装1块铁),之后每个箱子的容量都是它前一个箱子的容量的2倍。 但是他只会打铁,并不擅长制作箱子。制作完成后,他发现第1个箱子的容量是2(而不是1),
阅读全文
摘要:时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 131072K,其他语言262144K64bit IO Format: %lld 题目描述 圣诞节临近,彩虹岛的黑心商人𝑐𝑡𝑟的糖果店又开始热闹了起来,热心的𝑠𝑙𝑝来到𝑐𝑡𝑟的店里面帮忙包装糖果。店里面共有𝑛堆糖果,其
阅读全文
摘要:https://vjudge.net/problem/UVA-272 【分析】:标记一下。 【代码】:
阅读全文
摘要:D. Almost Difference time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Let's denote a func
阅读全文
摘要:C. Boxes Packing time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output C. Boxes Packing time li
阅读全文
摘要:B. The Modcrab time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output B. The Modcrab time limit
阅读全文
摘要:A. Hungry Student Problem time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Ivan's classes
阅读全文
摘要:C. Remove Extra One time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output You are given a perm
阅读全文
摘要:B. Position in Fraction time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output You have a fracti
阅读全文
摘要:A. Find Extra One time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output You have n distinct poi
阅读全文
摘要:官方题解:http://www.jnxxhzz.com/Article/article/9.html 2019: 特产 Description Input Output 输出一个整数表示dd带回来的特产重量 输出一个整数表示dd带回来的特产重量 Sample Input 2 3 6 1 3 Samp
阅读全文
摘要:Problem B: 狗哥的肚子 Description【http://gdutcode.sinaapp.com/problem.php?cid=1071&pid=1】 在 ACM 集训队中,狗哥的肚子形状多变,令人啧啧称奇,但是大家都有一个疑问,狗哥的肚子在最大的时候,能有多大呢?于是大家通过观察
阅读全文
摘要:Accept: 1164 Submit: 3722Time Limit: 1000 mSec Memory Limit : 32768 KB Accept: 1164 Submit: 3722Time Limit: 1000 mSec Memory Limit : 32768 KB Problem
阅读全文
摘要:Accept: 1040 Submit: 2314Time Limit: 1000 mSec Memory Limit : 32768 KB Accept: 1040 Submit: 2314Time Limit: 1000 mSec Memory Limit : 32768 KB Problem
阅读全文
摘要:计算机网络中采用循环冗余码来校验数据的正确性。其原理是:发送方计算出待发送的二进制数据的循环冗余码,并随同原数据一起发送到接收方;接收方通过重新计算接收到的数据的循环冗余码,并和收到的循环冗余码进行比较,如果两者相同则可判定所收到的数据是正确的,否则说明数据是错误的。其中计算二进制数据的循环冗余码的
阅读全文
摘要:A. Far Relative’s Birthday Cake time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Door's fa
阅读全文
摘要:【唯一分解定理】:https://www.cnblogs.com/mjtcn/p/6743624.html 假设x是一个正整数,它的值不超过65535(即1<x<=65535),请编写一个程序,将x分解为若干个素数的乘积。 Input 输入的第一行含一个正整数k (1<=k<=10),表示测试例的个
阅读全文
摘要:现在有一个等式如下:x^2+s(x,m)x-n=0。其中s(x,m)表示把x写成m进制时,每个位数相加的和。现在,在给定n,m的情况下,求出满足等式的最小的正整数x。如果不存在,请输出-1。 Input 有T组测试数据。以下有T(T<=100)行,每行代表一组测试数据。每个测试数据有n(1<=n<=
阅读全文
摘要:嗨!大家好,在TempleRun中大家都认识我了吧。我是又笨又穷的猫猫LKity。很高兴这次又与各位FZU的ACMer见面了。最近见到FZU的各位ACMer都在刻苦地集训,整天在日光浴中闲得发慌的我压力山大呀!于是,我准备为诸位编写一款小工具——LKity牌文本替换(众怒,:敢不敢更土点!)。这个小
阅读全文
摘要:某天,无聊的小斌叫上几个同学玩游戏,其中有比较笨的小兴,比较傻的小雪,可爱的小霞和自以为是的小楠。他们去找聪明的小明去给他们当裁判。判定谁取得游戏胜利。 而这个游戏是由小斌想个1到10000000的数字让大家猜,看谁先猜中。为了防止小斌作弊,小明记录下了游戏的整个过程。你的任务是判断小斌是否有作弊。
阅读全文
摘要:Oaiei居住在A城市,并且是这个城市建设的总设计师。最近有个问题一直困恼着他。A城市里有三个大型工厂,每个大型工厂每天都需要消耗大量的石油,现在城市里要建设一个石油中转站,从石油中转站到三个大型工厂都需要铺设石油管道。现在你的问题来了,应该如何建设这个石油中转站,使得石油中转站到三个大型工厂所需要
阅读全文
摘要:A. Vladik and Courtesy time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output At regular compet
阅读全文
摘要:A. Counterexample time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output A. Counterexample time
阅读全文
摘要:时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 131072K,其他语言262144K64bit IO Format: %lld 题目描述 Forever97与未央是一对笔友,他们经常互相写信。有一天Forever97去邮局寄信,发现邮局的收费方式变成了按字收费,收取的费用为总字数除了
阅读全文
摘要:时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 65536K,其他语言131072K64bit IO Format: %lld 题目描述 又到了一年一度,大四老学长们毕业设计选题的时候,一般指导老师都会为学生提供若干个选题供学生选择。大家都知道,有的课题,看上去高大上,实则含金量不高,
阅读全文
摘要:题目描述(https://www.nowcoder.com/acm/contest/51#question) 在cayun星球月亮大小都有一个规律,月亮为每30天一个周期,在这30天的周期里,月亮的大小分别为0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
阅读全文
摘要:A. Kyoya and Photobooks time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Kyoya Ootori is
阅读全文
摘要:能被2、3、4、5、6、7、8、9 等数整除的数的特征 性质1:如果数a、b都能被c整除,那么它们的和(a+b)或差(a-b)也能被c整除。 性质2:几个数相乘,如果其中有一个因数能被某一个数整除,那么它们的积也能被这个数整除。 能被2整除的数,个位上的数能被2整除(偶数都能被2整除),那么这个数能
阅读全文
摘要:A. Generous Kefa time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output One day Kefa found n ba
阅读全文
摘要:A. Minimum Difficulty time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output A. Minimum Difficu
阅读全文
摘要:A. Appleman and Easy Task time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output A. Appleman and
阅读全文
摘要:A. Magic Numbers time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output A. Magic Numbers time l
阅读全文
摘要:A. Mike and palindrome time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Mike has a string
阅读全文
摘要:B. Soldier and Badges time limit per test 3 seconds memory limit per test 256 megabytes input standard input output standard output B. Soldier and Bad
阅读全文
摘要:A. Taymyr is calling you time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Comrade Dujikov
阅读全文
摘要:A. Cakeminator time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output A. Cakeminator time limit
阅读全文
摘要:A. Helpful Maths time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Xenia the beginner math
阅读全文
摘要:A. Football time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output A. Football time limit per t
阅读全文
摘要:题目描述 输入n个正整数,(1<=n<=10000),要求输出最长的连号的长度。(连号指从小到大连续自然数) 输入输出格式 输入格式: 第一行,一个数n; 第二行,n个正整数,之间用空格隔开。 输出格式: 一个数,最长连号的个数。 输入输出样例 输入样例#1: 复制 10 3 5 6 2 3 4 5
阅读全文
摘要:题目描述 Bessie's cruel second grade teacher has assigned a list of N (1 <= N <= 100) positive integers I (1 <= I <= 10^60) for which Bessie must determin
阅读全文
摘要:题目背景 统计天数 题目描述 炎热的夏日,KC非常的不爽。他宁可忍受北极的寒冷,也不愿忍受厦门的夏天。最近,他开始研究天气的变化。他希望用研究的结果预测未来的天气。 经历千辛万苦,他收集了连续N(1<=N<=10^7)天的最高气温数据。 现在,他想知道最高气温一直上升的最长连续天数。 输入输出格式
阅读全文
摘要:题目背景(https://www.luogu.org/problemnew/show/P3742) umi 找到了一个神秘的函数 f。 题目描述 这个函数接受两个字符串 s1,s2。这些字符串只能由小写字母组成,并且具有相同的长度。这个函数的输出是另一个长度与 s1,s2 相同的字符串 g。g 的第
阅读全文
摘要:题目描述 已知 n 个整数 x1,x2,…,xn,以及一个整数 k(k<n)。从 n 个整数中任选 k 个整数相加,可分别得到一系列的和。例如当 n=4,k=3,4 个整数分别为 3,7,12,19 时,可得全部的组合与它们的和为: 3+7+12=22 3+7+19=29 7+12+19=38 3+
阅读全文
摘要:zb的生日 时间限制:3000 ms | 内存限制:65535 KB 难度:2 zb的生日 时间限制:3000 ms | 内存限制:65535 KB 难度:2 #include<stdio.h> #include<math.h> #include<limits.h> int n, total, mi
阅读全文
摘要:Bookshelf 2 Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 11105 Accepted: 4928 Description Farmer John recently bought another bookshelf
阅读全文
摘要:http://www.cppblog.com/MatoNo1/archive/2012/09/23/191708.html ——————————————————————————————————————————————————— 普通DFS(不加迭代)的优化方法主要有:(1)可行性剪枝,如果遇到已经无
阅读全文
摘要:题目描述 因为151既是一个质数又是一个回文数(从左到右和从右到左是看一样的),所以 151 是回文质数。 写一个程序来找出范围[a,b](5 <= a < b <= 100,000,000)( 一亿)间的所有回文质数; 输入输出格式 输入格式: 第 1 行: 二个整数 a 和 b . 输出格式:
阅读全文
摘要:题目描述(https://www.luogu.org/problemnew/show/1004) 设有N*N的方格图(N<=9),我们将其中的某些方格中填入正整数,而其他的方格中则放 人数字0。如下图所示(见样例): 某人从图的左上角的A点出发,可以向下行走,也可以向右走,直到到达右下角的B 点。在
阅读全文
摘要:B. Chtholly's request time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output B. Chtholly's requ
阅读全文
摘要:A. Scarborough Fair time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output A. Scarborough Fair
阅读全文
摘要:B. Tavas and SaDDas time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Once again Tavas star
阅读全文
摘要:C. Registration system time limit per test 5 seconds memory limit per test 64 megabytes input standard input output standard output A new e-mail servi
阅读全文
摘要:A. Raising Bacteria time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output A. Raising Bacteria t
阅读全文
摘要:B. BerSU Ball time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output B. BerSU Ball time limit pe
阅读全文
摘要:time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output One way to create a task is to learn from
阅读全文
摘要:A. Two Substrings time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output A. Two Substrings time
阅读全文
摘要:After you had helped George and Alex to move in the dorm, they went to help their friend Fedor play a new computer game «Call of Soldiers 3». The game
阅读全文
摘要:A. Bus to Udayland time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output A. Bus to Udayland ti
阅读全文
摘要:A. Maximum in Table time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output An n × n table a is
阅读全文
摘要:A. Flipping Game time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Iahub got bored, so he i
阅读全文
摘要:A. Buy a Shovel time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output A. Buy a Shovel time limi
阅读全文
摘要:A. New Year and Hurry time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output A. New Year and Hur
阅读全文
摘要:A. I_love_%username% time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Vasya adores sport
阅读全文
摘要:A. IQ test time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output A. IQ test time limit per tes
阅读全文