版权声明:原创,未经作者允许禁止转载 https://blog.csdn.net/Mr_wuyongcong/article/details/86541531
前言
新年新气象,我们又一度迎来新一年的模拟赛(谁想迎来)
总之,有来到了熟悉的地方——纪中。
成绩
是有算别人的
正题
计算系数【组合数,二项式定理】
之前做过,就直接放了
博客链接:
https://blog.csdn.net/Mr_wuyongcong/article/details/82502479
选择客栈【统计】
博客链接:
https://blog.csdn.net/Mr_wuyongcong/article/details/86540567
聪明的质监员【二分答案 前缀和】
博客链接:
https://blog.csdn.net/Mr_wuyongcong/article/details/86540688
观光公交【费用流】
博客链接:
https://blog.csdn.net/Mr_wuyongcong/article/details/86541082
T2 随机数据
#include<cstdio>
#include<cstdlib>
#include<ctime>
#define random(x) rand()%x
using namespace std;
int main()
{
srand(time(0));
//freopen("data.in","w",stdout);
printf("10 3 %d\n",random(10));
for(int i=1;i<=10;i++)
printf("%d %d\n",random(3),random(10));
}
T2 60分暴力
#include<cstdio>
#include<cctype>
#define ll long long
using namespace std;
int read() {
int x=0,f=1; char c=getchar();
while(!isdigit(c)) {if(c=='-')f=-f;c=getchar();}
while(isdigit(c)) x=(x<<1)+(x<<3)+c-48,c=getchar();
return x*f;
}
void print(int x){
if (x>9) print(x/10); putchar(x%10+48); return;
}
ll n,k,p,color[5000],cost[5000],ans;
int main()
{
freopen("data.in","r",stdin);
freopen("data.ans","w",stdout);
n=read();k=read();p=read();
for(ll i=1;i<=n;i++){
color[i]=read();cost[i]=read();
}
for(int i=1;i<=n;i++)
for(int j=i+1;j<=n;j++){
if(color[i]==color[j]){
for(int k=i;k<=j;k++)
if(cost[k]<=p){
ans++;
break;
}
}
}
print(ans);
}
T2 对拍
#include<windows.h>
#include<cstdio>
using namespace std;
int main()
{
while(1){
system("data.exe");
system("BL.exe");
system("T2.exe");
if(!system("fc data.ans data.out"))
printf("AC\n");
else
{
printf("WA\n");
break;
}
}
}
尾声
猩新年快乐