摘要: `#include include //用于 sqrt 函数 using namespace std; int n, k; int a[25]; // 题目说 n<=20,开稍大一点 int ans = 0; // 判断素数的函数 (标准模板) bool isPrime(int x) { if (x 阅读全文
posted @ 2026-01-05 00:37 gosaky 阅读(1) 评论(0) 推荐(0)
摘要: 点击查看代码 #include <iostream> using namespace std; int N, M, T; // 地图长宽,障碍物数量 int SX, SY, FX, FY; // 起点坐标 (Start), 终点坐标 (Finish) int mp[10][10]; // 地图数组: 阅读全文
posted @ 2026-01-04 23:33 gosaky 阅读(4) 评论(0) 推荐(0)
摘要: 点击查看代码 #include <iostream> using namespace std; // 题目说明 N, M <= 100,所以数组开稍微大一点防越界 const int MAXN = 105; int N, M; char field[MAXN][MAXN]; // 存地图 // 定义 阅读全文
posted @ 2026-01-04 17:01 gosaky 阅读(1) 评论(0) 推荐(0)
摘要: 点击查看代码 #include<bits/stdc++.h> using namespace std; typedef pair<int,int> PII; int n; int a[35][35]; int dx[4]={0,0,1,-1}; int dy[4]={1,-1,0,0}; void 阅读全文
posted @ 2025-12-12 16:40 gosaky 阅读(2) 评论(0) 推荐(0)
摘要: 点击查看代码 #include<bits/stdc++.h> using namespace std; const int N=1005; int n,m; char g[N][N]; //联通块对应的id int cid[N][N]; //连通块对应的大小 int csize[N*N]; //连通 阅读全文
posted @ 2025-12-12 16:35 gosaky 阅读(3) 评论(0) 推荐(0)
摘要: 点击查看代码 #include<bits/stdc++.h> using namespace std; int n,sum; int pascal[13][13]; int res[13]; bool used[13]; void dfs(int dep,int csum) { //当前和大于sum 阅读全文
posted @ 2025-12-10 16:44 gosaky 阅读(4) 评论(0) 推荐(0)
摘要: 点击查看代码 #include<bits/stdc++.h> using namespace std; int n,m; int a[25]; long long ans; bool prime(int x) { if(x==1||x!=2&&x%2==0) return false; for(in 阅读全文
posted @ 2025-12-09 00:51 gosaky 阅读(3) 评论(0) 推荐(0)
摘要: 点击查看代码 #include<bits/stdc++.h> using namespace std; string in,post; void preorder(int inl,int inr,int postl,int postr) { if(inl>inr||postl>postr) retu 阅读全文
posted @ 2025-12-09 00:27 gosaky 阅读(7) 评论(0) 推荐(0)
摘要: 点击查看代码 #include<bits/stdc++.h> using namespace std; typedef long long LL; const int N=1e5+10; LL a[N]; LL n,m; bool check(LL mid) { LL t=0,cnt=1; for( 阅读全文
posted @ 2025-12-08 17:35 gosaky 阅读(4) 评论(0) 推荐(0)
摘要: 点击查看代码 #include<bits/stdc++.h> using namespace std; typedef long long LL; const int N=1e6+10; int n; LL a[N],s[N]; int main() { cin>>n; LL sum=0; for( 阅读全文
posted @ 2025-12-08 16:41 gosaky 阅读(3) 评论(0) 推荐(0)