K - KazaQ’s Socks
#include <bits/stdc++.h>
using namespace std;
#define LL long long
int main()
{
LL n,k;
LL ca=1;
while(cin>>n>>k)
{
if(k<=n)
cout<<"Case #"<<ca++<<": "<<k<<endl;
else
{
LL tmp=(k-n)%(2*(n-1));
// cout<<tmp<<endl;
if(tmp==0)cout<<"Case #"<<ca++<<": "<<n<<endl;
else if(tmp==n-1)cout<<"Case #"<<ca++<<": "<<n-1<<endl;
else
{
cout<<"Case #"<<ca++<<": "<<tmp%(n-1)<<endl;
}
}
}
return 0;
}
K - KazaQ’s Socks的更多相关文章
- HDU6043 KazaQ's Socks
Problem Description KazaQ wears socks everyday. At the beginning, he has n pairs of socks numbered f ...
- 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 ...
- HDU6043 17多校1 KazaQ's Socks 水题
题目传送:http://acm.hdu.edu.cn/showproblem.php?pid=6043 Problem Description KazaQ wears socks everyday. ...
- 杭电 KazaQ's Socks
KazaQ wears socks everyday. At the beginning, he has n pairs of socks numbered from 1 to n in his cl ...
- 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 ...
- 【多校联合】(HDU6043)KazaQ's Socks
[多校联合](HDU6043)KazaQ's Socks 一条纯粹的水题,记录下只是因为自己错的太多而已. 原因在于对数据的细节的把握不佳. 原题 KazaQ's Socks Time Limit: ...
- 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 6043 - KazaQ's Socks | 2017 Multi-University Training Contest 1
/* HDU 6043 - KazaQ's Socks [ 找规律 ] | 2017 Multi-University Training Contest 1 题意: 一共 n 双袜子编号 1~n,每天 ...
随机推荐
- spring mvc 集成freemarker模板
主要使用到的jar 文件:spring mvc +freemarker.jar 第一步:spring mvc 集成 freemarker <!-- 定义跳转的文件的前后缀 ,视图模式配置--&g ...
- 【c++】动态内存
静态存储区:内存在程序编译的时候就已经分配好,这块内存在程序的整个运行期间都存在.它主要存放静态数据.全局数据和常量.注意:const常量在定义时必须初始化 栈区:在执行函数时,函数内局部变量的存储单 ...
- 【转】c++ 如何批量初始化数组 fill和fill_n函数的应用
http://blog.csdn.net/sunquana/article/details/9153213 一. fill和fill_n函数的应用: fill函数的作用是:将一个区间的元素都赋予val ...
- Linux 常用检测命令
1.uptime [root@smgsim02 ~]# uptime 15:08:15 up 98 days, 4:19, 2 users, load average: 0.07, 0.29, ...
- libevent HTTP client 的实现
my_conn_ = evhttp_connection_base_new(ev_base_,ev_dns_,host,port); struct evhttp_request *http_req; ...
- 解决cell切割线不是全屏问题
if ([_tableView respondsToSelector:@selector(setSeparatorInset:)]) { [_tableView setSeparatorInset:U ...
- instancetype VS id
英文好的直接读下面链接的文章就好了: http://stackoverflow.com/questions/8972221/would-it-be-beneficial-to-begin-using- ...
- 使用HD/IDE层的ioctl接口获取磁盘容量get_hdd_max_sector
利用HD/IDE layer的ioctl函数接口获取HD/IDE的磁盘容量.HDIO_DRIVE_TASK 能发出訪问LBA地址的命令.但不能读写数据. #include <stdio.h&g ...
- Android 4.4.2 动态加入JNI库方法记录 (二 app应用层)
欢迎转载,务必注明出处:http://blog.csdn.net/wang_shuai_ww/article/details/44458553 源代码下载地址:http://download.csdn ...
- HDU 5544 Ba Gua Zhen dfs+高斯消元
Ba Gua Zhen Problem Description During the Three-Kingdom period, there was a general named Xun Lu wh ...