KazaQ's Socks (找规律)
#include<iostream>
using namespace std;
#define ll long long
ll n, m;
ll t;
int main(){
while (cin >> n >> m){
//特判n=2
cout << "Case #" << ++t << ": ";
if (n == ){
cout << (m % ?:) << endl;
}
else if (n >= m){
cout << m << endl;
}
else{
m -= n;
ll d = m / (n - );
ll k = m % (n - );
if (k !=)cout << k << endl;
else{
if (d % == )cout << n << endl;
else cout << n- << endl;
} }
} }
题意:略
具体规律自己看一下
也就是这样的 1 2 3 4 1 2 3 1 2 4 1 2 3 1 2 4 1 2 3.。。。。
然后,自己去写就是了
KazaQ's Socks (找规律)的更多相关文章
- HDU 6043 KazaQ's Socks (规律)
Description KazaQ wears socks everyday. At the beginning, he has nn pairs of socks numbered from 11 ...
- 2017 Multi-University Training Contest - Team 1 1011&&HDU 6043 KazaQ's Socks【规律题,数学,水】
KazaQ's Socks Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)T ...
- HDU 6043 - KazaQ's Socks | 2017 Multi-University Training Contest 1
/* HDU 6043 - KazaQ's Socks [ 找规律 ] | 2017 Multi-University Training Contest 1 题意: 一共 n 双袜子编号 1~n,每天 ...
- 2017ACM暑期多校联合训练 - Team 1 1011 HDU 6043 KazaQ's Socks (找规律)
题目链接 Problem Description KazaQ wears socks everyday. At the beginning, he has n pairs of socks numbe ...
- 杭电 KazaQ's Socks
KazaQ wears socks everyday. At the beginning, he has n pairs of socks numbered from 1 to n in his cl ...
- HDU6043 17多校1 KazaQ's Socks 水题
题目传送:http://acm.hdu.edu.cn/showproblem.php?pid=6043 Problem Description KazaQ wears socks everyday. ...
- 2017 Multi-University Training Contest - Team 1 KazaQ's Socks
Problem Description KazaQ wears socks everyday. At the beginning, he has n pairs of socks numbered f ...
- hdu 3951 - Coin Game(找规律)
这道题是有规律的博弈题目,,, 所以我们只需要找出规律来就ok了 牛人用sg函数暴力找规律,菜鸟手工模拟以求规律...[牢骚] if(m>=2) { if(n<=m) {first第一口就 ...
- HDU 5703 Desert 水题 找规律
已知有n个单位的水,问有几种方式把这些水喝完,每天至少喝1个单位的水,而且每天喝的水的单位为整数.看上去挺复杂要跑循环,但其实上,列举几种情况之后就会发现是找规律的题了= =都是2的n-1次方,而且这 ...
- hdu4952 Number Transformation (找规律)
2014多校 第八题 1008 2014 Multi-University Training Contest 8 4952 Number Transformation Number Transform ...
随机推荐
- Springboot@Configuration和@Bean详解
Springboot@Configuration和@Bean详解 一.@Configuration @Target({ElementType.TYPE}) @Retention(RetentionPo ...
- elasticsearch概念
1.elasticsearch的核心概念 (1)Near Realtime(NRT):近实时,从写入数据到数据可以被搜索到有一个小延迟(大概1秒):基于es执行搜索和分析可以达到秒级 (2)Clust ...
- HDU6187(对偶图生成树)
Destroy Walls Time Limit: 8000/4000 MS (Java/Others) Memory Limit: 132768/132768 K (Java/Others)T ...
- xhr post请求
1. post提交的时候要设置post请求头,可以使用setRequestHeader(单独指定请求的某个http头) 2.通常在web开发中,使用表单提交数据的时候,一般是使用xml的格式进行的.可 ...
- SQL查询,关联查询的区别 (LEFT JOIN 、LEFT OUTER JOIN、INNER JOIN)
), f2 ) ) ), f2 ) ) ------------------------------------------------ ','a1') ','a2') ','a3') ','a4') ...
- BZOJ 1188: [HNOI2007]分裂游戏(multi-nim)
Time Limit: 10 Sec Memory Limit: 162 MBSubmit: 1386 Solved: 840[Submit][Status][Discuss] Descripti ...
- 洛谷P4725 【模板】多项式对数函数(多项式ln)
题意 题目链接 Sol 这个不用背XD 前置知识: \(f(x) = ln(x), f'(x) = \frac{1}{x}\) \(f(g(x)) = f'(g(x)) g'(x)\) 我们要求的是\ ...
- CSS琐碎知识点(持续补充)
一.字体单位,pt?px?em?rem? pt:磅,一种固定长度的绝对的度量单位,是能够使用测量设备测得的长度,印刷业上经常使用,一般用于页面打印排版. px:屏幕设备上能显示出的最小的一个物理点,这 ...
- Android为TV端助力 比较完善json请求格式
public static String getHttpText(String url) { if (MyApplication.FOR_DEBUG) { Log.i(TAG, "[getH ...
- Multithreading C++ Out of Core Sotring for Massive Data|多线程C++的大规模数据外部排序
先说一下,这个其实是我为实现PantaRay或者是类似Dreamworks的Out of Core点云GI的技术储备,为大规模点云光线跟踪所准备的第一步.在实际的应用中,int类型会被64bit的ui ...