题目链接:www.codeforces.com/problemset/problem/486/A
题意:求表达式f(n)的值。(f(n)的表述见题目)
C++代码:

#include <iostream>
using namespace std;
long long f(long long n)
{
if (n % == )
return n / ;
else
return n / - n;
}
int main()
{
long long n;
cin >> n;
cout << f(n) << endl;
return ;
}

C++

codeforces水题100道 第十题 Codeforces Round #277 (Div. 2) A. Calculating Function (math)的更多相关文章

  1. Codeforces Round #277 (Div. 2) A. Calculating Function 水题

    A. Calculating Function Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/4 ...

  2. Codeforces Round #277 (Div. 2)---A. Calculating Function (规律)

    Calculating Function time limit per test 1 second memory limit per test 256 megabytes input standard ...

  3. codeforces水题100道 第二十题 Codeforces Round #191 (Div. 2) A. Flipping Game (brute force)

    题目链接:http://www.codeforces.com/problemset/problem/327/A题意:你现在有n张牌,这些派一面是0,另一面是1.编号从1到n,你需要翻转[i,j]区间的 ...

  4. Codeforces Round #277 (Div. 2)A. Calculating Function 水

    A. Calculating Function   For a positive integer n let's define a function f: f(n) =  - 1 + 2 - 3 +  ...

  5. codeforces水题100道 第二十六题 Codeforces Beta Round #95 (Div. 2) A. cAPS lOCK (strings)

    题目链接:http://www.codeforces.com/problemset/problem/131/A题意:字符串大小写转换.C++代码: #include <cstdio> #i ...

  6. codeforces水题100道 第二十五题 Codeforces Round #197 A. Helpful Maths (Div. 2) (strings)

    题目链接:http://www.codeforces.com/problemset/problem/339/A题意:重新组合加法字符串,使得按照1,2,3的顺序进行排列.C++代码: #include ...

  7. codeforces水题100道 第二十四题 Codeforces Beta Round #85 (Div. 2 Only) A. Petya and Strings (strings)

    题目链接:http://www.codeforces.com/problemset/problem/112/A题意:忽略大小写,比较两个字符串字典序大小.C++代码: #include <cst ...

  8. codeforces水题100道 第二十二题 Codeforces Beta Round #89 (Div. 2) A. String Task (strings)

    题目链接:http://www.codeforces.com/problemset/problem/118/A题意:字符串转换……C++代码: #include <string> #inc ...

  9. codeforces水题100道 第十九题 Codeforces Round #109 (Div. 2) A. I_love_%username% (brute force)

    题目链接:http://www.codeforces.com/problemset/problem/155/A题意:找到当前最大值或者最小值出现的次数.“当前”的意思差不多是a[i]大于所有a[j]( ...

随机推荐

  1. Opengl绘制我们的小屋(四)第三人称漫游

    本节内容是在第一人称漫游上完成的,请先了解上文中第一人称漫游的实现. 这一节讲下第三人称漫游是如何实现,第三人称,简单来说,就是在你后面会跟着一台摄像机顺着你拍摄. 先看一下失败的尝试.这个方法是把人 ...

  2. 【转】WPF查找子控件和父控件方法

    一.查找某种类型的子控件,并返回一个List集合 public List<T> GetChildObjects<T>(DependencyObject obj, Type ty ...

  3. 推荐一个不错的关于Excel数据统计分析的公众号

  4. (笔记)Linux下的准确延时,#include <linux/delay.h>调用出错

    在编写应用层程序时,有时需要延时一下,这个时候该怎么办呢? 在内核代码中,我们经常会看到这样的头文件使用#include <linux/delay.h>,心想着直接调用这个就可以了吧!可是 ...

  5. [转]Android WiFi 掉线原因分析

    看到一个比较详细的分析wifi断开的文章.收藏一下. 原文: http://blog.csdn.net/chi_wy/article/details/50963279 原因1 .从Log分析来看,这个 ...

  6. MCMC采样理论的一点知识

    看了好多相关的知识,大致了解了一下马尔可夫链-蒙特卡罗采样理论,有必要记来下来. 蒙特卡罗积分:(来自:http://blog.csdn.net/itplus/article/details/1916 ...

  7. Xcode快捷键--灰常实用的快捷键,以后编程快捷多了

    从雨痕老大的博客上转来的 http://www.rainsts.net/article.asp?id=1066 读书人偷书不算窃 :)   1. 文件 CMD + N: 新文件CMD + SHIFT ...

  8. Spring JDBC删除数据

    以下示例将展示如何使用Spring jdbc执行删除数据库表中的记录,这里演示如何删除指定student表中的记录. 语法: String deleteQuery = "delete fro ...

  9. c# mvc 获取 HtmlHelper 表达式值和时间格式化 去边框

    /// <summary> /// 返回没有边框的只读的TextBox标签 /// </summary> /// <typeparam name="TModel ...

  10. python模块之 - subprocess执行unix/linux命令

    subprocess模块提供了一种一致的方法来创建和处理附加进程,与标准库中的其它模块相比,提供了一个更高级的接口,subprocess模块用来生成子进程,并可以通过管道连接它们的输入/输出/错误,以 ...