SGU 403 Scientific Problem
403. Scientific Problem
Memory limit: 65536
kilobytes
output: standard
Once
upon a time Professor Idioticideasinventor was travelling by train.
Watching cheerless landscape outside the window, he decided to invent
the theme of his new scientific work. All of a sudden a brilliant idea
struck him: to develop an effective algorithm finding an integer number,
which is x times less than the sum of all its integer positive predecessors, where number x is given. As far as he has no computer in the train, you have to solve this difficult problem.
The first line of the input file contains an integer number x (1 ≤ x ≤ 109).
Output an integer number — the answer to the problem.
sample input |
sample output |
1 |
3 |
sample input |
sample output |
2 |
5 |
#include<iostream>
#include<string.h>
#include<stdio.h>
#include<ctype.h>
#include<algorithm>
#include<stack>
#include<queue>
#include<set>
#include<math.h>
#include<vector>
#include<map>
#include<deque>
#include<list>
using namespace std;
int main()
{
int x;
scanf("%d",&x);
printf("%d\n",*x+);
return ;
}
SGU 403 Scientific Problem的更多相关文章
- SGU - 403 - Scientific Problem (水)
403. Scientific Problem Time limit per test: 0.25 second(s) Memory limit: 65536 kilobytes input: sta ...
- 找规律 SGU 107 987654321 problem
题目地址:http://acm.sgu.ru/problem.php?contest=0&problem=107 /* 题意:n位数的平方的后面几位为987654321的个数 尼玛,我看描述这 ...
- SGU 205. Quantization Problem
205. Quantization Problem time limit per test: 0.25 sec. memory limit per test: 65536 KB input: stan ...
- SGU 107 987654321 problem【找规律】
题目链接: http://acm.sgu.ru/problem.php?contest=0&problem=107 题意: 平方后几位为987654321的n位数有多少个 分析: 虽然说是水题 ...
- 数论 - SGU 107 987654321 problem
987654321 problem Problem's Link Mean: 略 analyse: 这道题目是道简单题. 不过的确要好好想一下: 通过简单的搜索可以知道,在N<9时答案一定为0, ...
- sgu 107 987654321 problem
其实挺水的,因为两个数平方,只有固定的后面几位数会影响到最后结果的后面几位数.也就是说,如果想在平方之后尾数为987654321,那么就有固定的几个尾数在平方后会是这个数,打个表,发现 10^8 内 ...
- SGU 403 Game with points
408. Game with points Time limit per test: 0.25 second(s)Memory limit: 65536 kilobytes input: standa ...
- 数论 - SGU 105 DIV3
SGU 105-DIV 3 Problem's Link Mean: 定义这样一种数列:1,12,123.. 给出一个n,求这个数列中能被3整除的数的个数. analyse: 这道题可以用分析的方法解 ...
- SGU 乱搞日志
SGU 100 A+B :太神不会 SGU 101 Domino: 题目大意:有N张骨牌,两张骨牌有两面有0到6的数字,能相连当且仅当前后数字相同,问能否有将N张骨牌连接的方案?思路:裸的欧拉回路,注 ...
随机推荐
- Ubuntu下使用Nginx+uWSGI+Flask(初体验)
Ubuntu 18.04,Nginx 1.14.0, uWSGI 2.0.17.1,Flask, 前言 Windows不支持uWSGI!为了上线自己的项目,只能选择Linux. 自己前面开发了一个Fl ...
- acm专题---KMP模板
KMP的子串长n,模式串长m,复杂度o(m+n),朴素做法的复杂度o((n-m+1)*m) 觉得大话数据结果上面这个讲得特别好 改进版本的KMP leetcode 28. Implement strS ...
- sqlserver中的全局变量总结
@@CONNECTIONS返回自上次启动 Microsoft? SQL Server? 以来连接或试图连接的次数.@@CPU_BUSY返回自上次启动 Microsoft? SQL Server? 以来 ...
- SqlServer性能优化 Sql语句优化(十四)
一:在较小的结果集上上操作 1.仅返回需要的列 2.分页获取数据 EF实现分页: public object getcp(int skiprows,int currentpagerows) { HRU ...
- hdu 5137 去掉一个点 使得最短路最大(2014广州现场赛 K题)
题意:从2~n-1这几个点中任意去掉一个点,使得从1到n的最短路径最大,如果任意去掉一个点1~n无通路输出Inf. Sample Input4 51 2 31 3 71 4 502 3 43 4 23 ...
- Spark-Streaming总结
文章出处:http://www.cnblogs.com/haozhengfei/p/e353daff460b01a5be13688fe1f8c952.html Spark_总结五 1.Storm 和 ...
- Spark(十一)Spark分区
一.分区的概念 分区是RDD内部并行计算的一个计算单元,RDD的数据集在逻辑上被划分为多个分片,每一个分片称为分区,分区的格式决定了并行计算的粒度,而每个分区的数值计算都是在一个任务中进行的,因此任务 ...
- 【LOJ】 #2545. 「JXOI2018」守卫
题解 只会蠢蠢的\(n^3\)--菜啊-- 我们发现最右的端点一定会选,看到的点一定是当前能看到的斜率最小的点变得更小一点,记录下这个点,在我们遇到一个看不到的点的时候,然后只用考虑R到它斜率最小的这 ...
- 自建YUM源以及相关维护
yum相关概念我这里就不做详细的讲解了,就是一个软件包管理工具.在企业中,很多时候进行编译了自己的RPM包,在搭建YUM的时候,希望将自定义的RPM加入到YUM源中,从而出现了下列方法. 一.配置私有 ...
- linux kernel.shmall shemax shemin解释
Linux X86-64操作系统,Oracle 10g数据库,由8G加到16G,把kernel.shmmax参数改到17179869184(16G)后,发现只要修改sga_max_size和s ...