codeforces 333A - Secrets
题意:保证不能正好配齐n,要求输出可以用的最大硬币数。
注意如果用到某种硬币,那么这种硬币就有无穷多个。所以11=3+3+3+3,12=9+9,13=3+3+3+3+3
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cmath>
#include<algorithm>
using namespace std; #define LL __int64 int main()
{
LL n,tot=;
scanf("%I64d",&n);
while()
{
if(n%tot){
printf("%I64d\n",n/tot+);
break;
}
tot*=; }
return ;
}
codeforces 333A - Secrets的更多相关文章
- Secrets CodeForces - 333A
Secrets CodeForces - 333A 题意:这个世界上只有这样面值的硬币:1,3,9,27,81,...有一个商人,某一天遇到了一个顾客,他购买了价值n的商品,发现用自己的硬币无法付给商 ...
- CodeForces 333A
Secrets Time Limit:1000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64u Submit Sta ...
- CodeForces 173B Chamber of Secrets spfa
Chamber of Secrets 题目连接: http://codeforces.com/problemset/problem/173/B Description "The Chambe ...
- Codeforces Round #194 (Div. 1) A. Secrets 数学
A. Secrets Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/333/problem/A ...
- CodeForces 173B Chamber of Secrets 二分图+最短路
题目链接: http://codeforces.com/problemset/problem/173/B 题意: 给你一个n*m的地图,现在有一束激光从左上角往左边射出,每遇到‘#’,你可以选择光线往 ...
- CodeForces 173B Chamber of Secrets (二分图+BFS)
题意:给定上一个n*m的矩阵,你从(1,1)这个位置发出水平向的光,碰到#可以选择四个方向同时发光,或者直接穿过去, 问你用最少的#使得光能够到达 (n,m)并且方向水平向右. 析:很明显的一个最短路 ...
- Codeforces Gym 100002 D"Decoding Task" 数学
Problem D"Decoding Task" Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com ...
- python爬虫学习(5) —— 扒一下codeforces题面
上一次我们拿学校的URP做了个小小的demo.... 其实我们还可以把每个学生的证件照爬下来做成一个证件照校花校草评比 另外也可以写一个物理实验自动选课... 但是出于多种原因,,还是绕开这些敏感话题 ...
- 【Codeforces 738D】Sea Battle(贪心)
http://codeforces.com/contest/738/problem/D Galya is playing one-dimensional Sea Battle on a 1 × n g ...
随机推荐
- Oracle 删除表分区
删除表分区(drop partition) 删除表分区包含两种操作,分别是: Ø 删除分区:alter table [tbname] drop partition [ptname] UPDA ...
- 【BZOJ】【2223】【COCI 2009】PATULJCI
可持久化线段树 同BZOJ 3524,但是不要像我一样直接贴代码……TAT白白WA了一次,so sad /*********************************************** ...
- cf 359A 359B
359A 如果有点在边上则最少两次 没有则最少操作4次 #include <cstdio> #include <cstring> #include <algorithm& ...
- app被Rejected 的各种原因翻译
1. Terms and conditions(法律与条款) 1.1 As a developer of applications for the App Store you are bound by ...
- POJ2442Sequence
http://poj.org/problem?id=2442 题意 :就是输入m个数集,每个含n个数,求从每个集合取一个数后,按非降序输出前n小的和. 思路 : 本来打算是用几个for循环的,后来觉得 ...
- Java Socket编程readLine返回null,read返回-1的条件
客户端正常关闭socket的时候,服务器端的readLine()方法会返回null,或者read()方法会返回-1
- 黑马程序员-C#学习笔记(二)
---------------------- ASP.Net+Android+IOS开发..Net培训.期待与您交流! ---------------------- - C# 学习笔记 一.变量与表达 ...
- TDD 用语
OOP 封装 继承 多态 SOLID SRP 单一职责 Single Responsibility Principle OCP 开放封闭 Open/Close Principle LS ...
- hdu1874 畅通工程续
http://acm.hdu.edu.cn/showproblem.php?pid=1874 //标准最短路模板 //需要注意的是两点间可能有多组 //需要取最短的 #include<iostr ...
- Solr查询详解
前言:上节是关于Solr的开发准备工作:.NET开发过程中的全文索引使用技巧之Solr(http://www.cnblogs.com/johnwood/p/3447242.html) 这节重点是讲So ...