题解 2821: 开关灯

来看看其他人写的题解吧!要先自己动手做才会有提高哦! 
返回题目 | 我来写题解

筛选

2821: 开关灯

摘要:耗时:1小时36分钟参考代码:n, m = map(int, input().split()) arr = [True for _ in range(n + 1)] for i in range(……

字典方法...............

摘要:解题思路:注意事项:参考代码:N,M = map(int,input().split()) dict1 = {i : i*0 for i in range(1,N+1)} dict2 = {i :……

2821: 开关灯

摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;const int N=1e5;//定义小一点int a[N] ;int main(……

Py2821-开关灯

摘要:参考代码:n,m=map(int,input().split())light=[1]*(n+1)for&nb……

2821: 开关灯

摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>typedef long long ll;const int N=1e5;ll a[N];using namespace s……

题解 2821: 开关灯

摘要:解题思路:注意事项:参考代码:n,m=map(int,input().strip().split())l = [0 for i in range(n)]for i in range(2,m+1,1):……

2821: 开关灯

摘要:解题思路:注意事项:参考代码:#include<iostream>#include<iomanip>#include<cmath>using namespace s……

2821: 开关灯

摘要:解题思路:注意事项:参考代码:#include <stdio.h>    int main()    {        int n, m, i, j,t=0;         int a[5001] ……

普通的写法

摘要:```cpp #include using namespace std; int a[5001],n,i,j,m; int main() { cin>>n>>m; boo……