935专题

[LeetCode] 935. Knight Dialer

题:https://leetcode.com/problems/shortest-bridge/description/ 题目 In a given 2D binary array A, there are two islands. (An island is a 4-directionally connected group of 1s not connected to any other

Codeforces Round 935 (Div. 3)------>C. Left and Right Houses

一,思路:直接从左到右枚举即可,用两个变量来维护左边的0的个数,右边1的个数。这题可能你会把四舍五入看成向上取整导致错误。 二,代码: #include <iostream>#include<algorithm>#include<cmath>#include<vector>using namespace std;void Solved() {int n;cin>>n;string st

Codeforces Round 935 (Div. 3)A~E

A. Setting up Camp 题目分析:  有三种人,内向、外向、综合,内向必须独自一个帐篷,外向必须3个人一个帐篷,综合介于1~3人一个帐篷,我们发现非法情况只会存在外向的人凑不成3个人一个帐篷的情况,因外向不够可以向综合人借,故将二者合并并判断: #include<bits/stdc++.h>#pragma GCC optimize("Ofast")#define INF

Codeforces Round 935 (Div. 3) (A~G)

1945A - Setting up Camp          题意:三种人安排住宿,a只能跟自己住,b只能三个人住,c能1~3个人,问最终最少房间数         思路:a单独安排,b放一起,不足三个人的用c补,然后c按照3人一房间尽可能分配          void solve() {int a , b , c;cin >> a >> b >> c;int ans = a +

935计算机学霸时间分配,720分,学霸总结的5个学习方法,取其精华必有所成

原标题:720分,学霸总结的5个学习方法,取其精华必有所成 为什么有的学生除了上课,平时不怎么学习,成绩依然名列前茅,而有的学生每天挑灯夜读,成绩还是不理想。 这是因为学习方法没找对,一个对的学习方法,往往会起到事半功倍的效果。 以下是一位考了720分的学霸总结的5个学习方法,希望对正在学习的孩子有所帮助。 ​ 制定学习计划 长计划,短安排 学习一定要有学习计划,有目的性的学习能有效激发学习动

leetcode - 935. Knight Dialer

Description The chess knight has a unique movement, it may move two squares vertically and one square horizontally, or two squares horizontally and one square vertically (with both forming the shape