zoukankan      html  css  js  c++  java
  • SGU 403 Scientific Problem

    403. Scientific Problem

    Time limit per test: 0.25 second(s)
    Memory limit: 65536 kilobytes
    input: standard
    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.

    Input

    The first line of the input file contains an integer number x (1 ≤ x ≤ 109).

    Output

    Output an integer number — the answer to the problem.

    Example(s)
    sample input
    sample output
    1
    
    3
    
    sample input
    sample output
    2
    
    5
    
     1 #include<iostream>  
     2 #include<string.h>  
     3 #include<stdio.h>  
     4 #include<ctype.h>  
     5 #include<algorithm>  
     6 #include<stack>  
     7 #include<queue>  
     8 #include<set>  
     9 #include<math.h>  
    10 #include<vector>  
    11 #include<map>  
    12 #include<deque>  
    13 #include<list>  
    14 using namespace std;
    15 int main()
    16 {
    17     int x;
    18     scanf("%d",&x);
    19     printf("%d
    ",2*x+1);
    20     return 0;
    21 } 
    View Code
  • 相关阅读:
    52、saleforce 第一篇
    nodejs自定义模块
    NodeJS require路径
    Angularjs ngTable使用备忘
    HTML5拖拽功能中 dataTransfer对象详解
    Javascript闭包深入解析及实现方法
    Grunt实例
    Grunt插件uglify
    javascript 将字符串当函数执行
    多个springboot项目部署在同一tomcat上,出现jmx错误
  • 原文地址:https://www.cnblogs.com/qscqesze/p/3879996.html
Copyright © 2011-2022 走看看