ZOJ 1633
迭代
每个数对应前面的一个数
- #include<stdio.h>
- #include<iostream>
- using namespace std;
- #define max 88
- long long s[max], n,p;
- char *first="T.T^__^";
- void Init()
- {
- s[]=;
- s[]=;
- int i;
- for(i=; i <= max; i++)
- s[i]=s[i-]+s[i-];
- }
- int getp()
- {
- int i=;
- while(n>s[i])
- i++;
- return i-;
- }
- int main()
- {
- Init();
- while(scanf("%lld",&n)!=EOF)
- {
- while(n>)
- {
- p=getp();
- n-=s[p];
- }
- cout<<first[n-]<<endl;
- }
- return ;
- }
ZOJ 1633的更多相关文章
- zoj 1633 Big String
Big String Time Limit: 2 Seconds Memory Limit: 65536 KB We will construct an infinitely long string ...
- ZOJ People Counting
第十三届浙江省大学生程序设计竞赛 I 题, 一道模拟题. ZOJ 3944http://www.icpc.moe/onlinejudge/showProblem.do?problemCode=394 ...
- ZOJ 3686 A Simple Tree Problem
A Simple Tree Problem Time Limit: 3 Seconds Memory Limit: 65536 KB Given a rooted tree, each no ...
- ZOJ Problem Set - 1394 Polar Explorer
这道题目还是简单的,但是自己WA了好几次,总结下: 1.对输入的总结,加上上次ZOJ Problem Set - 1334 Basically Speaking ac代码及总结这道题目的总结 题目要求 ...
- ZOJ Problem Set - 1392 The Hardest Problem Ever
放了一个长长的暑假,可能是这辈子最后一个这么长的暑假了吧,呵呵...今天来实验室了,先找了zoj上面简单的题目练练手直接贴代码了,不解释,就是一道简单的密文转换问题: #include <std ...
- ZOJ Problem Set - 1049 I Think I Need a Houseboat
这道题目说白了是一道平面几何的数学问题,重在理解题目的意思: 题目说,弗雷德想买地盖房养老,但是土地每年会被密西西比河淹掉一部分,而且经调查是以半圆形的方式淹没的,每年淹没50平方英里,以初始水岸线为 ...
- ZOJ Problem Set - 1006 Do the Untwist
今天在ZOJ上做了道很简单的题目是关于加密解密问题的,此题的关键点就在于求余的逆运算: 比如假设都是正整数 A=(B-C)%D 则 B - C = D*n + A 其中 A < D 移项 B = ...
- ZOJ Problem Set - 1001 A + B Problem
ZOJ ACM题集,编译环境VC6.0 #include <stdio.h> int main() { int a,b; while(scanf("%d%d",& ...
- zoj 1788 Quad Trees
zoj 1788 先输入初始化MAP ,然后要根据MAP 建立一个四分树,自下而上建立,先建立完整的一棵树,然后根据四个相邻的格 值相同则进行合并,(这又是递归的伟大),逐次向上递归 四分树建立完后, ...
随机推荐
- jquery validation插件使用
首先需要引入jQuery.js和jquery.validate.js 以下面代码为例: <form id="mainform"> <fieldset> &l ...
- CFont 字体类
CFont 字体类 初始化函数 CreateFontIndirect 初始化一个由LOGFONT结构给出其特征的CFont对象 CreateFont 初始化用指定特性定义的CFont对象 Create ...
- 防止ajax非正常访问
http://www.cnblogs.com/yagzh2000/archive/2013/06/09/3128042.html http://www.cnblogs.com/henw/archive ...
- no-cache、max-age=0、must-revalidate区别
之前深入搜索了多次,根据stackoverflow的回答进行一些总结(http://stackoverflow.com/questions/18148884/difference-between-no ...
- LeetCode_Single Number II
Given an array of integers, every element appears three times except for one. Find that single one. ...
- Cracking the coding interview--Q2.1
原文: Write code to remove duplicates from an unsorted linked list.FOLLOW UPHow would you solve this p ...
- 读、写SD上的文件请按如下步骤进行
1.调用Environment的getExternalStorageState()方法判断手机上是否插入了SD卡,并且应用程序具有读写SD卡的权限.例如使用如下代码//Environment.getE ...
- 使用 PIVOT 和 UNPIVOT 行转列 列转行 报表统计 函数
官方文档:http://technet.microsoft.com/zh-cn/library/ms177410(v=SQL.105).aspx 可以使用 PIVOT 和 UNPIVOT 关系运算符将 ...
- css浮动+应用(瀑布流效果的实现)
首先是index.html文件: <!DOCTYPE html> <html> <head> <meta charset="UTF-8"& ...
- [Qt] Mask 蒙版
[Qt] Mask 蒙版 Mask能够覆盖在其他的widget上面,实现一些动态图片的加载效果.下面给出代码. mask.h #ifndef MASK_HJ #define MASK_HJ #incl ...