(水题) Div 3 -- SGU -- 105
链接:
http://vj.acmclub.cn/contest/view.action?cid=168#problem/E
问题描述
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的更多相关文章
- 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 ...
- 水题 Codeforces Round #105 (Div. 2) B. Escape
题目传送门 /* 水题:这题唯一要注意的是要用double,princess可能在一个小时之内被dragon赶上 */ #include <cstdio> #include <alg ...
- SGU 538. Emoticons 水题
538. Emoticons 题目连接: http://acm.sgu.ru/problem.php?contest=0&problem=538 Description A berland n ...
- 水题 Codeforces Round #302 (Div. 2) A Set of Strings
题目传送门 /* 题意:一个字符串分割成k段,每段开头字母不相同 水题:记录每个字母出现的次数,每一次分割把首字母的次数降为0,最后一段直接全部输出 */ #include <cstdio> ...
- Codeforces Round #368 (Div. 2) A. Brain's Photos (水题)
Brain's Photos 题目链接: http://codeforces.com/contest/707/problem/A Description Small, but very brave, ...
- 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 ...
- 水题 Codeforces Round #299 (Div. 2) A. Tavas and Nafas
题目传送门 /* 很简单的水题,晚上累了,刷刷水题开心一下:) */ #include <bits/stdc++.h> using namespace std; ][] = {" ...
- 水题 Codeforces Round #304 (Div. 2) A. Soldier and Bananas
题目传送门 /* 水题:ans = (1+2+3+...+n) * k - n,开long long */ #include <cstdio> #include <algorithm ...
- 水题 Codeforces Round #303 (Div. 2) A. Toy Cars
题目传送门 /* 题意:5种情况对应对应第i或j辆车翻了没 水题:其实就看对角线的上半边就可以了,vis判断,可惜WA了一次 3: if both cars turned over during th ...
随机推荐
- TCP/IP知识总结(TCP/IP协议族读书笔记三)
接下来,总结传输层的两大协议UDP和TCP. 一.UDP(用户数据报协议) 讲UDP之间,先了解两个概念:有连接和无连接. 有连接:通信之前,通信双方必须建立一条通道: 无连接:不需要建立通道,发送方 ...
- Haskell语言学习笔记(62)Divisible
Divisible class Contravariant f => Divisible f where divide :: (a -> (b, c)) -> f b -> f ...
- win10为什么不能把文件直接拖拽
- jsp常见的指令总结
一.三个编译指令 1.page指令: 首先,我们要明确一点就是page指令是一个全局指令,针对当前页面,其次我们再来深挖他的功能,它到底有哪些功能那,在我们程序中起到什么作用??? a.语法结构:&l ...
- hdoj1087 (DP--LIS)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1087 思路:这题很简单了,纯LIS的解法,没有一点变形,由于数据小,使用O(n^2)LIS解法就足够了 ...
- chest
chest - 必应词典 美[tʃest]英[tʃest] n.胸部:胸膛:有…胸的:胸部…的 网络胸围:箱子:胸腔 变形复数:chests:
- Frog and Portal(思维好题)
Frog and Portal https://hihocoder.com/problemset/problem/1873 时间限制:1000ms 单点时限:1000ms 内存限制:512MB 描述 ...
- Asp.net实现同页面内多图片自动上传并带预览显示
FileUpload控件实现单按钮图片自动上传并带预览显示 1.实现原理: 此方法适合针对有后台生成的图片相关内容,例如购物网站商品展示页面中的封面图片,图片的数量由后台访问数据库,并加载到页面.这种 ...
- css菜鸟学习之text-align属性,行内元素,块级元素居中详解
一.text-align属性 1.text-align用来设置元素中的的文本对齐方式,例如:如果需要设置图片的对齐方式,需要设置图片的父元素的text-align属性: 2.text-align只对文 ...
- centos7下创建mysql5.6多实例
一.mysql安装目录说明mysql5.6以二进制安装包安装在/data/mysql56下数据目录为/data/mysql56/data下配置文件为/etc/my.cnf下 二.多实例目录说明/mys ...