链接:

http://vj.acmclub.cn/contest/view.action?cid=168#problem/E

时限:250MS     内存:4096KB     64位IO格式:%I64d & %I64u

问题描述

There is sequence 1, 12, 123, 1234, ..., 12345678910, ... . Given first N elements of that sequence. You must determine amount of numbers in it that are divisible by 3.

Input

Input contains N (1<=N<=231 - 1).

Output

Write answer to the output.

Sample Input

4

Sample Output

2

还以为是每位数代表一个数呢!唉,题没懂

代码:

#include<iostream>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cmath>
#include<algorithm>
#include<queue> using namespace std; const long long MOD = ; int main()
{
int n; while(scanf("%d", &n), n)
{
int sum = n/*;
if(n%==)
sum ++; printf("%d\n", sum);
}
return ;
}

(水题) Div 3 -- SGU -- 105的更多相关文章

  1. Div 3 - SGU 105(找规律)

    分析:很容易知道序列1,2,3, 4,5, 6......与3的关系就是1,2, 0,1, 2,0,......如果是在一个数后面添加一个数就变成了这种序列1, 0, 0, 1, 0, 0, 1, 0 ...

  2. 水题 Codeforces Round #105 (Div. 2) B. Escape

    题目传送门 /* 水题:这题唯一要注意的是要用double,princess可能在一个小时之内被dragon赶上 */ #include <cstdio> #include <alg ...

  3. SGU 538. Emoticons 水题

    538. Emoticons 题目连接: http://acm.sgu.ru/problem.php?contest=0&problem=538 Description A berland n ...

  4. 水题 Codeforces Round #302 (Div. 2) A Set of Strings

    题目传送门 /* 题意:一个字符串分割成k段,每段开头字母不相同 水题:记录每个字母出现的次数,每一次分割把首字母的次数降为0,最后一段直接全部输出 */ #include <cstdio> ...

  5. Codeforces Round #368 (Div. 2) A. Brain's Photos (水题)

    Brain's Photos 题目链接: http://codeforces.com/contest/707/problem/A Description Small, but very brave, ...

  6. Codeforces Beta Round #9 (Div. 2 Only) B. Running Student 水题

    B. Running Student 题目连接: http://www.codeforces.com/contest/9/problem/B Description And again a misfo ...

  7. 水题 Codeforces Round #299 (Div. 2) A. Tavas and Nafas

    题目传送门 /* 很简单的水题,晚上累了,刷刷水题开心一下:) */ #include <bits/stdc++.h> using namespace std; ][] = {" ...

  8. 水题 Codeforces Round #304 (Div. 2) A. Soldier and Bananas

    题目传送门 /* 水题:ans = (1+2+3+...+n) * k - n,开long long */ #include <cstdio> #include <algorithm ...

  9. 水题 Codeforces Round #303 (Div. 2) A. Toy Cars

    题目传送门 /* 题意:5种情况对应对应第i或j辆车翻了没 水题:其实就看对角线的上半边就可以了,vis判断,可惜WA了一次 3: if both cars turned over during th ...

随机推荐

  1. tomcat APR的配置

    Tomcat 可以使用 APR 来提供超强的可伸缩性和性能,更好地集成本地服务器技术. APR(Apache Portable Runtime) 是一个高可移植库,它是 Apache HTTP Ser ...

  2. AutoConfig工具使用

    下载安装Auto工具包: http://code.taobao.org/mvn/repository/com/alibaba/citrus/tool/antx-autoconfig/1.0.9/ant ...

  3. Gearman安装及使用

    基础安装包 yum install vim wget gcc gcc-c++ make dos2unix gperf libevent libevent-devel zlib-devel bzip2- ...

  4. 【转】oracle 体系结构

    前几天面试的时候面试官才问过我Oracle的体系结构,让我在一张白纸上画出来.回头想想当时答得还不错,大部分内容都描述出来了,呵呵,刚才在网上看到一篇讲解ORACLE体系结构的文章,觉得不错,转过来存 ...

  5. Windows 2008开启远程桌面连接

    具体请看下面的截图. 最重要的就是要打开远程允许远程桌面的默认端口 3389 的入站规则,我第一次弄,这一端口没打开,折腾了很久!!! 第一.首先打开“服务器管理器”—“配置”—“高级安全Window ...

  6. sysdig

    centos 7 安装 https://sysdig.com/opensource/sysdig/install/ 1) Trust the Draios GPG key, configure the ...

  7. mybatis动态sql trim

    trim标记是一个格式化的标记,可以完成set或者是where标记的功能,如下代码: 1. select * from user <trim prefix="WHERE" p ...

  8. Path-O-LOGIC Keynote

    [Path-O-LOGIC Keynote] 1. OnSpawned()OnSpawned(SpawnPool pool) 2. OnDespawned()OnDespawned(SpawnPool ...

  9. python之字典【dict】

    #Auther Bob#--*--conding:utf-8 --*-- #创建一个字典dictdic1 = {'k1':'v1','k2':'v2'}dic2 = dict(k1='v1',k2=' ...

  10. 8-导弹拦截一(n^2 and nlogn)

    /*某国为了防御敌国的导弹袭击,研发出一套导弹拦截系统.但是这种导弹拦截系统有一个缺陷:虽然它的第一发拦截炮弹能够到达任意的高度,但是以后每一发拦截炮弹都不能高于前一发的高度.某天,雷达捕捉到敌国的多 ...