HDU 6043 KazaQ's Socks (规律)】的更多相关文章

/* HDU 6043 - KazaQ's Socks [ 找规律 ] | 2017 Multi-University Training Contest 1 题意: 一共 n 双袜子编号 1~n,每天早上选取编号最小的一双穿, 当晚上发现只剩一双袜子能穿时,把之前的袜子都洗了, 明天晚上就可以穿了. 问第 k 天穿的是编号为几的袜子 分析: n = 3时模拟每天穿的袜子 : 1 2 3 1 2 1 3 1 2 1 3 ... 规律如上 */ #include <bits/stdc++.h> u…
KazaQ's Socks Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 338    Accepted Submission(s): 212 Sample Input 3 7 3 6 4 9 Sample Output Case #1: 3 Case #2: 1 Case #3: 2 Source 2017 Multi-Unive…
Description KazaQ wears socks everyday. At the beginning, he has nn pairs of socks numbered from 11 to nn in his closets. Every morning, he puts on a pair of socks which has the smallest number in the closets. Every evening, he puts this pair of sock…
题目链接 Problem Description KazaQ wears socks everyday. At the beginning, he has n pairs of socks numbered from 1 to n in his closets. Every morning, he puts on a pair of socks which has the smallest number in the closets. Every evening, he puts this pa…
题意:有n双袜子,编号1到n,放在衣柜里,每天早晨取衣柜中编号最小的袜子穿,晚上将这双袜子放在篮子里,当篮子里有n-1双袜子时,清洗袜子,直到第二天晚上才洗好,并将洗好的袜子重新放回衣柜. 分析:规律为 1.n=2时,1 2 1 2 1 2 1 2…… 2.n=3时,1 2 3 1 2 1 3 1 2 1 3…… 3.n=4时,1 2 3 4 1 2 3 1 2 4 1 2 3 1 2 4…… 4.n=5时,1 2 3 4 5 1 2 3 4 1 2 3 5 1 2 3 4 1 2 3 5………
规律题.我自己写的规律对长度为2的要特判,wa一万次... 规律题目,容易错的反而是数据小的时候,得长记性. 题解:规律 先是1~n 然后1~n-2 n-1  1~n-2 n 交替出现 比如当n=4 的时候 1 2 3 4  1 2 3 1 2 4  1 2 3  1 2 4 ...... AC代码: #include <cstdio> #include <iostream> using namespace std; typedef long long ll; int main()…
题目传送:http://acm.hdu.edu.cn/showproblem.php?pid=6043 Problem Description KazaQ wears socks everyday. At the beginning, he has n pairs of socks numbered from 1 to n in his closets. Every morning, he puts on a pair of socks which has the smallest number…
KazaQ wears socks everyday. At the beginning, he has n pairs of socks numbered from 1 to n in his closets. Every morning, he puts on a pair of socks which has the smallest number in the closets. Every evening, he puts this pair of socks in the basket…
Problem Description KazaQ wears socks everyday. At the beginning, he has n pairs of socks numbered from 1 to n in his closets. Every morning, he puts on a pair of socks which has the smallest number in the closets. Every evening, he puts this pair of…
[多校联合](HDU6043)KazaQ's Socks 一条纯粹的水题,记录下只是因为自己错的太多而已. 原因在于对数据的细节的把握不佳. 原题 KazaQ's Socks Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others) Problem Description KazaQ wears socks everyday. At the beginning, he has n pair…