摘要: **链接:**https://www.acwing.com/problem/content/description/3764/ 题目: 给定一个长度为 n 的整数数组 a1,a2,…,an。 请你找到数组中只出现过一次的数当中最小的那个数。 输出找到的数的索引编号。 a1 的索引编号为 1,a2 的 阅读全文
posted @ 2021-11-23 21:06 longwind7 阅读(21) 评论(0) 推荐(0) 编辑
摘要: **链接:**https://www.acwing.com/problem/content/118/ 题目: “飞行员兄弟”这个游戏,需要玩家顺利的打开一个拥有 16 个把手的冰箱。 已知每个把手可以处于以下两种状态之一:打开或关闭。 只有当所有把手都打开时,冰箱才会打开。 把手可以表示为一个 4× 阅读全文
posted @ 2021-11-23 10:18 longwind7 阅读(13) 评论(0) 推荐(0) 编辑
摘要: **链接:**https://www.acwing.com/problem/content/97/ 题目: 你玩过“拉灯”游戏吗? 25 盏灯排成一个 5×5 的方形。 每一个灯都有一个开关,游戏者可以改变它的状态。 每一步,游戏者可以改变某一个灯的状态。 游戏者改变一个灯的状态会产生连锁反应:和这 阅读全文
posted @ 2021-11-22 20:34 longwind7 阅读(9) 评论(0) 推荐(0) 编辑
摘要: **链接:**https://www.acwing.com/problem/content/description/1210/ 题目: 小明正在玩一个“翻硬币”的游戏。 桌上放着排成一排的若干硬币。我们用 * 表示正面,用 o 表示反面(是小写字母,不是零)。 比如,可能情形是:**oo***ooo 阅读全文
posted @ 2021-11-19 15:45 longwind7 阅读(75) 评论(0) 推荐(0) 编辑
摘要: **链接:**https://www.cnblogs.com/longwind7/p/15531056.html 题目: 100 可以表示为带分数的形式: 还可以表示为: 注意特征:带分数中,数字 1∼9 分别出现且只出现一次(不包含 0)。 类似这样的带分数,100 有 11 种表示法。 输入格式 阅读全文
posted @ 2021-11-18 18:35 longwind7 阅读(41) 评论(0) 推荐(0) 编辑
摘要: 链接: 题目: Problem Description The GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one 阅读全文
posted @ 2021-11-17 22:18 longwind7 阅读(37) 评论(0) 推荐(0) 编辑
摘要: **链接:**https://www.acwing.com/problem/content/description/95/ 题目: 从 1∼n 这 n 个整数中随机选出 m 个,输出所有可能的选择方案。 输入格式 两个整数 n,m ,在同一行用空格隔开。 输出格式 按照从小到大的顺序输出所有方案,每 阅读全文
posted @ 2021-11-17 21:58 longwind7 阅读(50) 评论(0) 推荐(0) 编辑
摘要: 闰年判断 #include<bits/stdc++.h> using namespace std; //const int N=10001; int n; int main() { cin>>n; if(n%400==0||(n%4==0&&n%100!=0)) cout<<"yes"<<endl; 阅读全文
posted @ 2021-11-16 09:06 longwind7 阅读(15) 评论(0) 推荐(0) 编辑
摘要: 特殊回文数 #include<bits/stdc++.h> using namespace std; int n; int f5(int x) { int a[5],sum=0; for(int i=0;i<5;i++) { a[i]=x%10; sum+=a[i]; x/=10; } if(a[0 阅读全文
posted @ 2021-11-15 16:04 longwind7 阅读(33) 评论(0) 推荐(0) 编辑
摘要: 基础练习 十进制转十六进制 进制转换忘了怎么转了....又用笔画了一下才弄明白,最后还得加一个0的判断,真烦 #include<bits/stdc++.h> using namespace std; char inttochar(int a) { if(a>=0&&a<=9) return a+'0 阅读全文
posted @ 2021-11-15 00:16 longwind7 阅读(20) 评论(0) 推荐(0) 编辑