终于也是会了这么经典的题目 摘要:解题思路:注意事项:偶数灯是开着,奇数灯是开着,其实不难啊,换个思路,一定要有思考的抽象的计算思维参考代码:n,m=map(int,input().split())l=[0 for i in rang…… 题解列表 2023年05月05日 0 点赞 0 评论 422 浏览 评分:0.0
2821: 开关灯 摘要:解题思路:注意事项:参考代码:n,m=map(int,input().split())l=[1]*nfor i in range(1,m+1): for j in range(1,n+1): …… 题解列表 2023年02月13日 0 点赞 0 评论 486 浏览 评分:0.0
开关灯的详细解答 摘要:#include<stdio.h>int main(){ int m,n,i,j; scanf("%d %d",&n,&m); //输出顺序不能错 int a[n+1]; /*第一个人的行为*/ f…… 题解列表 2023年02月14日 0 点赞 0 评论 336 浏览 评分:0.0
2821: 开关灯 摘要:参考代码:#include<stdio.h> #include<math.h> int main() { int n,m; scanf("%d %d",&n,&m); …… 题解列表 2023年02月28日 0 点赞 0 评论 307 浏览 评分:0.0
2821: 开关灯 摘要:解题思路:注意事项:参考代码:N,M = map(int,input().split()) lights = [1] * N # 初始化列表 1为开,-1为关 closed = [] fo…… 题解列表 2023年03月04日 0 点赞 0 评论 360 浏览 评分:0.0
开关灯 C简单易懂 摘要:#### 解题思路: 用数组模拟开关灯 #### 参考代码 ```cpp #include #include #define maxn 5010 int a[maxn]; int …… 题解列表 2023年04月07日 0 点赞 0 评论 483 浏览 评分:0.0
判断逗号的输出个数 摘要:解题思路:注意事项:参考代码:#include <stdio.h>#include<string.h>int main(){ int N, M,count=0; int a[5000]; …… 题解列表 2023年04月19日 0 点赞 0 评论 281 浏览 评分:0.0
普通的写法 摘要:```cpp #include using namespace std; int a[5001],n,i,j,m; int main() { cin>>n>>m; boo…… 题解列表 2023年05月01日 0 点赞 0 评论 340 浏览 评分:0.0
绕了好久,用数组方便,还是离不开for,累了哈哈 摘要:解题思路:建议用flag语句做判断,数组1、0开关注意事项:参考代码:#include<stdio.h>#define maxSize 50001int main(){ int arr[maxSize…… 题解列表 2023年01月19日 0 点赞 0 评论 442 浏览 评分:0.0
简单又实用 摘要:```cpp #include #include using namespace std; int main() { int N, M; cin >> N >> M; …… 题解列表 2023年07月12日 0 点赞 0 评论 631 浏览 评分:0.0