链接:

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. pycharm ideavimrc设置备忘

    文件存放位置 windows下 C:\Users\你的用户名\.ideavimrc 注:如果要映射pycharm 中的一些命令可以 在pycharm 中 edit->Macros->Sta ...

  2. 面向对象三大特性一一多态(polymorphism)

    package com.bjsxt.oop.polymorphism; public class Animal { public void voice(){ System.out.println(&q ...

  3. JSP复习(part 3 )

    3.4.4 request对象提供了一些用来获取客户信息的方法,利用这些方法,可以获取客户端的IP地址 协议等有关信息 3.5 request对象和response对象相对应,用于响应客户请求,由服务 ...

  4. select 中添加option的注意

    在平时写JS中经常要给Select添加option,如果我们把option中的数据用一个字符串来表示: eg: var strOption='<option>1</option> ...

  5. python引入模块时import与from ... import的区别(转)

    import datetime是引入整个datetime包,如果使用datetime包中的datetime类,需要加上模块名的限定. 1 import datetime 2 3 print datet ...

  6. DBA 招聘

    数据库管理员(资深) 眼控科技 10-19万 72小时反馈 上海 6小时前 大专及以上 2年以上经验 普通话 25-35岁 绩效奖金 带薪年假 午餐补助 定期体检 年底双薪 五险一金 职位描述: 工作 ...

  7. luoguP1080 国王游戏 (贪心+高精度)

    题目链接:https://www.luogu.org/problemnew/show/P1080 参考:https://www.luogu.org/problemnew/solution/P1080 ...

  8. 如何添加ECSHOP广告位置

    如何添加ECSHOP广告位置 我们都知道ecshop系统默认的广告位置非常的少,但是一个电子商务网站岂能离开广告?庆幸的是,ecshop预留了足够强大的组件让我们能够完全有可能实现任意我们想要广告位置 ...

  9. oracle在centos6.5安装

    说明 很多操作是默认,具体定制另说. 安装 参考http://www.linuxidc.com/Linux/2014-02/97374p4.htm 这篇是上面那篇的整合版:http://www.cnb ...

  10. HttpApplicationState与HttpApplication

    HttpApplicationState 类的单个实例在客户端第一次从某个特定的 ASP.NET 应用程序虚拟目录中请求任何 URL 资源时创建.对于 Web 服务器上的每个 ASP.NET 应用程序 ...