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张骨牌连接的方案?思路:裸的欧拉回路,注 ...
随机推荐
- python 元组分组并排序
# -*- coding: utf-8 -*- # @Time : 2018/8/31 14:32 # @Author : cxa # @File : glomtest.py # @Software: ...
- Tomcat实现多域名之间session共享
最近启用二级域名后,面临一个主域名与二级域名之间 session 不能共享的问题,带来的麻烦就是用户在主域名登陆,但由于二级域名 session 不能共享 ,因此无法进行登陆的操作,对一些功能有一些影 ...
- 【本地服务器】用nodejs搭建最简单、轻量化的http server
1. 引言 前端程序猿主要关注的是页面,你可能根本就用不到.net,java,php等后台语言. 但是你制作出来的网页总要运行.总要测试吧?——那就免不了用到http server.我先前都是用vis ...
- JS实现全选、反选、不选
JS实现全选.反选.不选 效果图: 代码如下,复制即可使用: <!DOCTYPE html> <html> <head> <meta charset=&quo ...
- MySQL缓存命中率概述及如何提高缓存命中率
MySQL缓存命中率概述 工作原理: 查询缓存的工作原理,基本上可以概括为: 缓存SELECT操作或预处理查询(注释:5.1.17开始支持)的结果集和SQL语句: 新的SELECT语句或预处理查询语句 ...
- C++ 必须使用初始化列表
继承关系中,父类无默认构造函数 类类型类成员变量无默认构造函数 const类型成员变量 引用类型成员变量 不使用初始化列表,在创建对象调用构造函数之前会对所有的成员变量进行默认初始化,然后再执行构造函 ...
- getch与getchar区别
getch(): 所在头文件:conio.h 函数用途:从控制台读取一个字符,但不显示在屏幕上 getchar(): 所在头文件:stdio.h getch与getchar基本功能相同,差别是getc ...
- 聚类:(K-means)算法
1.归类: 聚类(clustering) 属于非监督学习 (unsupervised learning) 无类别标记(class label) 2.举例: 3. K-means 算法: ...
- **PHP foreach 如何判断为数组最后一个最高效?
http://www.zhihu.com/question/20158667 其他方法: $list = array('a', 'b', 'c'); foreach($list as $k=>$ ...
- HBase(二)CentOS7.5搭建HBase1.2.6HA集群
一.安装前提 1.HBase 依赖于 HDFS 做底层的数据存储 2.HBase 依赖于 MapReduce 做数据计算 3.HBase 依赖于 ZooKeeper 做服务协调 4.HBase源码是j ...