ural 1222. Chernobyl’ Eagles
1222. Chernobyl’ Eagles
Memory limit: 64 MB
Input
Output
Sample
| input | output | 
|---|---|
| 5 | 6 | 
Problem Source: The Seventh Ural State University collegiate programming contest
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <deque>
#include <vector>
#include <queue>
#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <ctime>
using namespace std;
typedef long long LL;
typedef double DB;
#define For(i, s, t) for(int i = (s); i <= (t); i++)
#define Ford(i, s, t) for(int i = (s); i >= (t); i--)
#define Rep(i, t) for(int i = (0); i < (t); i++)
#define Repn(i, t) for(int i = ((t)-1); i >= (0); i--)
#define rep(i, x, t) for(int i = (x); i < (t); i++)
#define MIT (2147483647)
#define INF (1000000001)
#define MLL (1000000000000000001LL)
#define sz(x) ((int) (x).size())
#define clr(x, y) memset(x, y, sizeof(x))
#define puf push_front
#define pub push_back
#define pof pop_front
#define pob pop_back
#define ft first
#define sd second
#define mk make_pair
inline void SetIO(string Name) {
string Input = Name+".in",
Output = Name+".out";
freopen(Input.c_str(), "r", stdin),
freopen(Output.c_str(), "w", stdout);
} inline int Getint() {
int Ret = ;
char Ch = ' ';
while(!(Ch >= '' && Ch <= '')) Ch = getchar();
while(Ch >= '' && Ch <= '') {
Ret = Ret*+Ch-'';
Ch = getchar();
}
return Ret;
} const int N = , Mod = ;
int Arr[N], Len;
int n; inline void Input() {
scanf("%d", &n);
} inline void Mul(int x) {
For(i, , Len) Arr[i] *= x;
For(i, , Len) {
Arr[i+] += Arr[i]/Mod;
Arr[i] %= Mod;
}
while(Arr[Len+]) {
Len++;
Arr[Len+] += Arr[Len]/Mod;
Arr[Len] %= Mod;
}
} inline void Solve() {
Arr[] = , Len = ;
while(n > ) Mul(), n -= ;
if(n == ) Mul(), n -= ;
if(n == ) Mul(), n -= ;
if(n == ) Mul(), n -= ; printf("%d", Arr[Len]);
Ford(i, Len-, ) printf("%04d", Arr[i]);
puts("");
} int main() {
#ifndef ONLINE_JUDGE
SetIO("F");
#endif
Input();
Solve();
return ;
}
ural 1222. Chernobyl’ Eagles的更多相关文章
- 记忆化搜索(DFS+DP) URAL 1223 Chernobyl’ Eagle on a Roof
		题目传送门 /* 记忆化搜索(DFS+DP):dp[x][y] 表示x个蛋,在y楼扔后所需要的实验次数 ans = min (ans, max (dp[x][y-i], dp[x-1][i-1]) + ... 
- URAL 1223. Chernobyl’ Eagle on a Roof
		题目链接 以前做过的一题,URAL数据强点,优化了一下. #include <iostream> #include <cstdio> #include <cstring& ... 
- URAL DP第一发
		列表: URAL 1225 Flags URAL 1009 K-based Numbers URAL 1119 Metro URAL 1146 Maximum Sum URAL 1203 Scient ... 
- SQL SERVER错误:已超过了锁请求超时时段。 (Microsoft SQL Server,错误: 1222)
		在SSMS(Microsoft SQL Server Management Studio)里面,查看数据库对应的表的时候,会遇到"Lock Request time out period e ... 
- 后缀数组 POJ 3974 Palindrome && URAL 1297 Palindrome
		题目链接 题意:求给定的字符串的最长回文子串 分析:做法是构造一个新的字符串是原字符串+反转后的原字符串(这样方便求两边回文的后缀的最长前缀),即newS = S + '$' + revS,枚举回文串 ... 
- ural 2071. Juice Cocktails
		2071. Juice Cocktails Time limit: 1.0 secondMemory limit: 64 MB Once n Denchiks come to the bar and ... 
- ural 2073. Log Files
		2073. Log Files Time limit: 1.0 secondMemory limit: 64 MB Nikolay has decided to become the best pro ... 
- ural 2070. Interesting Numbers
		2070. Interesting Numbers Time limit: 2.0 secondMemory limit: 64 MB Nikolay and Asya investigate int ... 
- ural 2069. Hard Rock
		2069. Hard Rock Time limit: 1.0 secondMemory limit: 64 MB Ilya is a frontman of the most famous rock ... 
随机推荐
- hiho一下 第九十六周 数论五·欧拉函数
			题目1 : 数论五·欧拉函数 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 小Hi和小Ho有时候会用密码写信来互相联系,他们用了一个很大的数当做密钥.小Hi和小Ho约定 ... 
- 【SpringMVC】SpringMVC系列15之SpringMVC最佳实践
			15.SpringMVC最佳实践 15.1.遵循Restful API最佳实践 参考:http://segmentfault.com/a/1190000002949234 15.2.统一返回字段 15 ... 
- 【JAVA、C++】LeetCode 015 3Sum
			Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all un ... 
- CodeForces - 426A(排序)
			Sereja and Mugs Time Limit: 1000MS Memory Limit: 262144KB 64bit IO Format: %I64d & %I64u Sub ... 
- Ubuntu13.04 安装 chrome
			1.chrome官网下载deb安装包:https://www.google.com/intl/zh-CN/chrome/browser/ 2.进入下载好的目录执行:sudo dpkg -i googl ... 
- Action返回类型
			1.返回ascx页面return PartialView(); 2.Content(),返回文本ContentResultreturn Content("这是一段文本"); 3.J ... 
- Java中栈结构的自我实现
			package com.pinjia.shop.common.collection; /** * Created by wangwei on 2017/1/3. */ public class MyL ... 
- Hibernate常见问题
			问题1,hql条件查询报错 执行Query session.createQuery(hql) 报错误直接跳到finally 解决方案 加入 <prop key="hibernate.q ... 
- windows下同时安装python2与python3
			由于python2与python3并不相互兼容,并且差别较大,所以有时需要同时安装,但在操作命令行时,怎么区别python2与python3呢? 1.下载并安装Python 2.7.9和Python ... 
- Vim折叠模式设置
			参考文章:http://www.cnblogs.com/welkinwalker/archive/2011/05/30/2063587.html set foldmethod=indent " ... 
