A 循环移位后的矩阵相似检查 模拟 class Solution {
public:bool areSimilar(vector<vector<int>> &mat, int k) {int m mat.size(), n mat[0].size();k % n;auto g mat;for (int i 0; i < m; i)if (i & 1)rotate(mat[i].begin(), mat[i].begin() …
A.Counting Passes(暴力)
题意:
给定 n n n个学生的分数,以及及格分 x x x ,问多少人及格了。
分析:
暴力枚举,依次判断每个学生的分数即可。
代码:
#include <bits/stdc.h>
using namespace s…