摘要: 题目描述 从 1~n 这 n 个整数中随机选出 m 个,输出所有可能的选择方案。n>0, 0<=m<=n, n+(n-m)<=25。 输入 一个整数n。 输出 按照从小到大的顺序输出所有方案,每行1个。首先,同一行内的数升序排列,相邻两个数用一个空格隔开。其次,对于两个不同的行,对应下标的数一一比较 阅读全文
posted @ 2018-07-05 17:49 oc_co 阅读(316) 评论(0) 推荐(0) 编辑
摘要: 题目描述 求 a 乘 b 对 p 取模的值,其中 1≤a,b,p≤10^18。 输入 第一行a,第二行b,第三行p。 输出 一个整数,表示a*b mod p的值。 样例输入 样例输出 6 #include <bits/stdc++.h> using namespace std; #define ll 阅读全文
posted @ 2018-07-04 13:16 oc_co 阅读(238) 评论(0) 推荐(0) 编辑
摘要: 题目描述 求 a 的 b 次方对 p 取模的值,其中 1≤a,b,p≤10^9 输入 三个用空格隔开的整数a,b和p。 输出 一个整数,表示a^b mod p的值。 样例输入 样例输出 阅读全文
posted @ 2018-07-04 10:29 oc_co 阅读(945) 评论(0) 推荐(0) 编辑
摘要: 我是怎么在不知道这一对函数的情况下活到今天的,以前碰到cin TLE的时候总是傻乎乎地改成scanf,甚至还相信过C++在IO方面效率低下的鬼话,殊不知这只是C++为了兼容C而采取的保守措施。 tie tie是将两个stream绑定的函数,空参数的话返回当前的输出流指针。 #include <ios 阅读全文
posted @ 2018-06-07 18:26 oc_co 阅读(715) 评论(0) 推荐(1) 编辑
摘要: 题目描述 Persona5 is a famous video game. In the game, you are going to build relationship with your friends. You have N friends and each friends have his 阅读全文
posted @ 2018-06-05 18:49 oc_co 阅读(336) 评论(1) 推荐(0) 编辑
摘要: 题目描述 There are N boxes arranged in a circle. The i-th box contains Ai stones.Determine whether it is possible to remove all the stones from the boxes 阅读全文
posted @ 2018-04-21 18:08 oc_co 阅读(177) 评论(0) 推荐(0) 编辑
摘要: 题目描述 A multi-digit column addition is a formula on adding two integers written like this: A multi-digit column addition is written on the blackboard, 阅读全文
posted @ 2018-04-21 16:16 oc_co 阅读(195) 评论(0) 推荐(0) 编辑
摘要: 题目描述 Aoki loves numerical sequences and trees.One day, Takahashi gave him an integer sequence of length N, a1,a2,…,aN, which made him want to construc 阅读全文
posted @ 2018-04-12 23:44 oc_co 阅读(136) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> #include <string> #include <cstring> #include <cstdio> using namespace std; const int maxn = 1000; struct bign{ int d[maxn], len; 阅读全文
posted @ 2018-04-11 16:45 oc_co 阅读(116) 评论(0) 推荐(0) 编辑
摘要: 题目描述 Snuke lives in another world, where slimes are real creatures and kept by some people. Slimes come in N colors. Those colors are conveniently num 阅读全文
posted @ 2018-04-10 23:59 oc_co 阅读(171) 评论(0) 推荐(0) 编辑