A Live Love
水
#include <algorithm>
#include<cstdio>
#include<cstring>
using namespace std;
typedef long long ll;
const int inf = 0x3f3f3f3f;
const int maxn = 1e5 + 1;
int main()
{
int t;
scanf("%d", &t);
while(t--)
{
int n,m;
scanf("%d%d",&n,&m);
if(m==0){
printf("0 0\n");
continue;
}
if(n==m){
printf("%d %d\n",n,m);
continue;
}
if(n>=2*m-1){
printf("%d %d\n",m,1);
continue;
}
for(int i=2;i<=m;i++) {
if (n - m >= (m / i + (m % i != 0)) - 1) {
printf("%d %d\n", m, i);
break;
}
}
}
return 0;
}
B Red Black Tree
留坑
C Halting Problem
题意:自定义了一些程序,然后问程序会不会崩溃,也就是会不会有死循环出现
思路:队友写的,大致就是同一步不可以运行一摸一样的两次吧
#include <algorithm>
#include<cstdio>
#include<cstring>
using namespace std;
typedef long long ll;
const int inf = 0x3f3f3f3f;
const int maxn = 1e5 + 1;
struct com{
char cm[4];
int v,k;
}prog[10007];
bool vstd[256][10007];
int main()
{
int n,t;
scanf("%d", &t);
while(t--) {
scanf("%d",&n);
for(int i=1;i<=n;i++){
scanf("%s%d",prog[i].cm,&prog[i].v);
if(prog