比赛链接:https://codeforces.com/contest/1433 #A. Boring Apartments ##题解 模拟即可。 ##代码 #include <bits/stdc++.h> using namespace std; int main() { ios::sync_wi ...
分类:
其他好文 时间:
2020-10-21 20:39:03
阅读次数:
25
#include <bits/stdc++.h> #include <bits/extc++.h> using namespace std; using namespace __gnu_pbds; typedef pair<int,int> pii; tree<pii,null_type,less< ...
分类:
其他好文 时间:
2020-10-21 20:30:50
阅读次数:
25
#include <bits/stdc++.h> using namespace std; int a[103][103],m; int xx[4]={0,0,1,-1},yy[4]={1,-1,0,0}; int f[103][103]; bool mp[103][103]; void dfs(i ...
分类:
其他好文 时间:
2020-10-20 16:35:04
阅读次数:
25
1 #include<bits/stdc++.h> 2 void quickSort(int a[],int first,int end) 3 { 4 if(first==end) return; 5 int i = first,j = end,temp; 6 while(i<j){ 7 while ...
分类:
编程语言 时间:
2020-10-20 16:26:37
阅读次数:
21
Prime digit replacements 枚举每一位放数字还是放未知的,如果为止的就拿1代替单独存 因为要有8个,所以我们可知未知的一定是三的倍数,末尾一定是1,3,7,然后暴力搞一搞(剪枝跑得飞快) 1 #include<bits/stdc++.h> 2 #define reg regis ...
分类:
其他好文 时间:
2020-10-19 22:57:02
阅读次数:
18
废话不多说开代码 在父进程调用wait() #include<stdio.h> #include<unistd.h> #include<sys/wait.h> int main(int argc,char *argv[]){ int rc=fork(); if(rc==0){ printf("i a ...
分类:
系统相关 时间:
2020-10-19 22:56:22
阅读次数:
29
#include <iostream> #include <cstring> using namespace std; char a[260]; int main() { int len,k; cin>>a; cin>>k; len=strlen(a); while(k--) { for(int i ...
分类:
其他好文 时间:
2020-10-19 22:33:48
阅读次数:
21
//第一次尝试:#include<stdio.h> int main() { int arr[] = { 1,2,3,4,5,6,7 };//查找6 int left = 0; int right = sizeof(arr) / sizeof(arr[0]) - 1; //printf("%d\n" ...
分类:
其他好文 时间:
2020-10-19 22:32:05
阅读次数:
15
求这个灯管的发光样式种类,发光的部分需连在一起 思路 二进制枚举+检测连通,信誓旦旦地交了个69;事后发现建图的时候少建了一条边,分没了 #include<bits/stdc++.h> using namespace std; const int N=8; int vis[N], light[N]; ...
分类:
其他好文 时间:
2020-10-18 17:13:14
阅读次数:
40
#include<iostream> #include<cstdio> #include<algorithm> #include<cmath> #define N 500005 using namespace std; int n,m,s,x,y; int tot,fr[N],nxt[N << 1] ...
分类:
其他好文 时间:
2020-10-18 17:08:25
阅读次数:
33