摘要:
`#include include //用于 sqrt 函数 using namespace std; int n, k; int a[25]; // 题目说 n<=20,开稍大一点 int ans = 0; // 判断素数的函数 (标准模板) bool isPrime(int x) { if (x 阅读全文
摘要:
点击查看代码 #include <iostream> using namespace std; int N, M, T; // 地图长宽,障碍物数量 int SX, SY, FX, FY; // 起点坐标 (Start), 终点坐标 (Finish) int mp[10][10]; // 地图数组: 阅读全文
摘要:
点击查看代码 #include <iostream> using namespace std; // 题目说明 N, M <= 100,所以数组开稍微大一点防越界 const int MAXN = 105; int N, M; char field[MAXN][MAXN]; // 存地图 // 定义 阅读全文
摘要:
点击查看代码 #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 阅读全文
摘要:
点击查看代码 #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]; //连通 阅读全文
摘要:
点击查看代码 #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 阅读全文
摘要:
点击查看代码 #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( 阅读全文