参考代码:
#include<bits/stdc.h>
using namespace std;
typedef long long ll;
int data[105][105];int main()
{ios::sync_with_stdio(false);int n;cin >> n;for(int i 1; i < n; i){for(int j 1; j < i; j){cin >> data[i][j];}}int…
思路: 这道题一开始想复杂了,其实这么小的数据量直接暴力求解即可。
参考代码:
#include<bits/stdc.h>
using namespace std;
typedef long long ll;
int m 30, n 50;bool checkL(int x, int y) //判断坐标是否超出边界
{if(x &g…
#include<bits/stdc.h>
using namespace std;
typedef long long ll;
ll n, k;
vector<ll> width, height;bool check(ll length) //判断边长为length的正方形都否满足需求
{ll sum 0; //记录能切成的最大方块数 for(int i 0; i < n; i){sum (width[i] / …
参考代码:
#include<bits/stdc.h>
using namespace std;
typedef long long ll;
int e[55][55], vis[55][55]; //e矩阵表示障碍物信息,vis矩阵表示点是否被访问过
int m 30, n 50;
struct node{ //定义结构体,用于存放点的信息 i…
参考代码:
#include<bits/stdc.h>
using namespace std;
typedef long long ll;
vector<int> v[100005]; //定义容器用于存放第i篇帖子被点赞的时间 int main()
{ios::sync_with_stdio(false); int n, d, k;cin >> n >> d >> k;in…
参考代码:
#include<bits/stdc.h>
using namespace std;int main()
{ios::sync_with_stdio(false); string str;cin >> str;int sum 0;int left, right;char s;int len str.size();for(int i 0; i < len; i) //依次循环每一个字符,…