SDUACM省赛排位2019 Round1总结

怎么偏偏这个时候CF炸了啊mmp!

鬼知道自己交的对不对啊

UPD:全挂了 CF Nmsl

UPD2:目前填坑 A B E F G(5/12)

Problem A Gym100963B

暴力枚举,最多只需要考虑到2*a[n]的大小

考场上写了个结论发现是伪证

但最后CF修完才发现

CF Nmsl

代码如下:

/*******************
Problem:2019 SDU Ranking A
Author:CXY1999
Status:Coding
Head Vision 2.1
*******************/
#include<cstdio>
#include<iostream>
#include<cstring>
#include<cstdlib>
#include<climits>
#include<vector>
#include<set>
#include<cmath>
#include<queue>
#include<utility>
#include<algorithm>
#define pb push_back
#define BG begin()
#define ED end()
typedef long long LL;
using namespace std;
const int maxn = 1000005;
int a[maxn];
int cnt[maxn];
int n;
int gre(int k)
{
	int Ans=0;
	for(int i=n;i>=1;i--)
	{
		if(k>=a[i])
		{
			Ans+=k/a[i];
			k-=(k/a[i])*a[i];
		}
	}
	return Ans;
}
int main()
{
	int Cas=1;
	while((scanf("%d",&n)==1)&&n)
	{
		printf("Case #%d: ",Cas);
		Cas++; 
		for(int i=1;i<=n;i++)
		{
			scanf("%d",&a[i]);
		}
		if(a[1]!=1)
		{
			puts("Cannot pay some amount");
			continue;
		}
		memset(cnt,63,sizeof(cnt));
		cnt[0]=0;
		for(int j=1;j<=n;j++)
		for(int i=1;i<=2*a[n];i++)
		{
			if(i-a[j]>=0)
			cnt[i]=min(cnt[i],cnt[i-a[j]]+1);
		}
		bool flag=true;
		for(int i=1;i<=2*a[n];i++)
		{
			if(cnt[i]<gre(i))
			{
				flag=false;
				break;
			}
		}
		if(flag)
		{
			puts("OK");
		}
		else puts("Cannot use greedy algorithm");
	}
	
}

Problem B Gym100963C

表达式求值

考场写挂一处傻逼地方+没读完题就开敲

赛后补的 有点冗余代码 看看有没有时间改良一个

/*******************
Problem:2019 SDU Ranking B
Author:CXY1999
Status:Coding
Head Vision 2.1
*******************/
#include<cstdio>
#include<iostream>
#include<cstring>
#include<cstdlib>
#include<climits>
#include<vector>
#include<set>
#include<cmath>
#include<queue>
#include<utility>
#include<algorithm>
#define pb push_back
#define BG begin()
#define ED end()
typedef long long LL;
using namespace std;
char buf[10000];
#define NULLOP 0 
int R1,R2;
char R3;
bool Exp;
void check()
{
	if((R1<0)||(R1>9999)||(R2<0)||(R2>9999))Exp=1;
}
int main()
{
	while(scanf("%s",buf)==1)
	{
		Exp=0;
		R1=0;
		R2=0;
		R3=NULLOP;
		int l=strlen(buf);
		for(int i=0;i<l;i++)
		{
			if(isdigit(buf[i]))
			{
				R2*=10;
				R2+=buf[i]-'0';
			}
			else if(buf[i]=='=')
			{
				switch(R3)
				{
					case '+':
					{
						R1+=R2;
						R2=0;
						break;
					} 
					case '-':
					{
						R1-=R2;
						R2=0;
						break;
					}
					case '*':
					{
						R1*=R2;
						R2=0;
						break;
					}
					case NULLOP:
					{
						R1=R2;
						R2=0;
						break;
					}
				}
				check();
				if(Exp)puts("E");
				else cout<<R1<<endl; 
			}
			else{
				switch(R3)
				{
					case '+':
					{
						R1+=R2;
						R2=0;
						break;
					} 
					case '-':
					{
						R1-=R2;
						R2=0;
						break;
					}
					case '*':
					{
						R1*=R2;
						R2=0;
						break;
					}
					case NULLOP:
					{
						R1=R2;
						R2=0;
						break;
					}
					
				}
				R3=buf[i];
			}
			check();
		}
	}
}

Problem C Gym100963F

看着像是网络流

 不会做 过后再补吧

UPD:队友已经AC了 正在填坑

Problem D Gym100963I

计算几何板子题

没带板子

mmp

一万句mmp

UPD:这题代码等我有时间重新码个计算几何的轮子搞上去再说吧

Problem E Gym100963J

这题本质就是求个ax+b=cy+d=k (x \subseteq \mathbb{N},y\subseteq \mathbb{N},k\subseteq \mathbb{N})

然后我直接考虑成了k\ mod\ a&=b\\ k\ mod\ c&=d

上来就劈里啪啦写个CRT了然后疯狂WA

发现自己蠢了(没说互质,需要写exCRT)

然后回头一想这不是exGCD傻逼题吗

移项之后就是一个典型的Ax+By=C的exGCD能做的傻逼题

/*******************
Problem:2019 SDU Ranking D
Author:CXY1999
Status:Coding
Head Vision 2.1
*******************/
#include<cstdio>
#include<iostream>
#include<cstring>
#include<cstdlib>
#include<climits>
#include<vector>
#include<set>
#include<cmath>
#include<queue>
#include<utility>
#include<algorithm>
#define pb push_back()
#define BG begin()
#define ED end()
typedef long long LL;
using namespace std;
LL GCD(LL A,LL B){return (B==0)?A:GCD(B,A%B);}
LL LCM(LL A,LL B){return A/GCD(A,B)*B;}
void exgcd(LL a,LL b,LL& d,LL& x,LL& y)
{
    if(!b) { d = a; x = 1; y = 0; }
    else{ exgcd(b, a%b, d, y, x); y -= x*(a/b); }
}
bool solve(LL a,LL b,LL c,LL &x,LL &y)
{
	LL d=0;
	exgcd(a,b,d,x,y);
	LL k=c/d;
	if(c%d){
		printf("Impossible\n");
		return 0;
	}
	x=k*x;
	LL R=fabs(b/d);
	while(x<=0)x=x+1e4*R;
	x=x%R;
	while(x<=0)x+=R;
	y=(c-a*x)/b;
	return 1;
}
 
//求Ax+By=C的一组解 
int main()
{
	LL n,m,a,k;
	while((cin>>n>>m>>a>>k)&&n&&m&&a&&k)
	{
		LL x,y;
		if(solve(a,-m,n-k,x,y))
		{
			cout<<a*x+k<<endl;
		}
	}
}

Problem F Gym100837A

签到题 直接乱写就行

/*******************
Problem:2019 SDU  Ranking F
Author:CXY1999
Status:Coding
Head Vision 2.1
*******************/
#include<cstdio>
#include<iostream>
#include<cstring>
#include<cstdlib>
#include<climits>
#include<vector>
#include<set>
#include<cmath>
#include<queue>
#include<utility>
#include<algorithm>
#define pb push_back
#define BG begin()
#define ED end()
typedef long long LL;
using namespace std;
LL P;
int MP;
int check(int a)
{
	P=0;
	MP=0;
	int l=floor(sqrt(a)+0.5);
	for(int i=2;i<l;i++)
	{
		if(a%i==0)
		{
			P+=i;
			MP=max(MP,i);
		}
		while(a%i==0)a/=i;
	}
	if(a!=1)
	{
		P+=a;
		MP=max(MP,a);
	}
	return MP-(P-MP);
}
int main()
{
	freopen("a.in","r",stdin);
	freopen("a.out","w",stdout);
	int a,b;
	cin>>a>>b;
	int c=check(a);
	int d=check(b);
	if(c>d)puts("a");
	else puts("b");
}

Problem G Gym100837B

除法模拟,这里除数只要有相同的即可

赛场这题开晚了 加急狂打还没打对 心里一句mmp不知道当不当讲

/*******************
Problem:2019 SDU Ranking G
Author:CXY1999
Status:Coding
Head Vision 2.1
*******************/
#include<cstdio>
#include<iostream>
#include<cstring>
#include<cstdlib>
#include<climits>
#include<vector>
#include<set>
#include<cmath>
#include<queue>
#include<utility>
#include<algorithm>
#define pb push_back()
#define BG begin()
#define ED end()
typedef long long LL;
using namespace std;
const int maxn =2000000+5;
int Cs[maxn];//³ýÊý 
int Ys[maxn];//ÓàÊý 
int main()
{
	freopen("b.in","r",stdin);
	freopen("b.out","w",stdout);
	int x,y;
	int st=0;
	memset(Cs,-1,sizeof(Cs));
	cin>>x>>y;
	x%=y;
	 
	while(true)
	{
		if(x==0)
		{
			cout<<st<<" "<<0<<endl; 
			return 0;
		}
		if(Cs[x]!=-1)
		{
			int R=Cs[x];
			cout<<R<<" "<<st-R<<endl;
			return 0;
		}
		Cs[x]=st;
		x*=10;
		st++;
		x%=y;
	}
	return 0;
} 

Problem H Gym100837C

队友写了一发WA on 15

回头看看到底写了啥再说吧

PS:我云玩家这题我没看

Problem I Gym100837D

计算几何题

具体先坑着

Problem J Gym100837E

计算音符时值并简化

考场上贪心炸了

我觉得需要DP

具体坑着

Problem K Gym100837F

给出两两之间的胜负情况并希望1号赢,且竞赛树最矮(就是进行的淘汰轮数要尽可能少)

问多少种方案

树规

具体坑着

Problem L Gym100837G

啥玩意连题意都读不懂

我八成是学了假的英文

坑着(摔)

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
bugku s1 awd排位赛-12是Bugku安全平台上举办的一场AWD(Attack and Defense)排位赛的第12轮比赛。Bugku是一个致力于网络安全技术研究和交流的平台,这场比赛的目的是为了检验参赛者在攻击和防御方面的技术实力。 在AWD比赛中,参赛队伍被分为进攻方和防守方。进攻方需要利用各种手段,如漏洞利用、渗透测试等,成功攻击防守方的系统或应用程序,获取旗帜(Flag)作为证明。而防守方则需要尽可能地去发现并修补自己系统或应用程序中的漏洞,以防止被攻击方获取旗帜。 在bugku s1 awd排位赛-12中,参赛者们经过激烈的竞争,展示了他们在网络安全领域的知识和技能。比赛中的题目可能涉及到各种不同的技术,如Web安全、二进制安全、密码学等。参赛者需要运用他们的专业知识和创新思维来解决这些挑战。 AWD比赛不仅仅是一场技术竞赛,更是一个学习和提高的机会。通过参与这类比赛,参赛者可以锻炼自己的技术能力,增强他们对网络安全的理解和认识。此外,比赛还促进了参赛队伍之间的交流和合作,提供了一个分享和学习经验的平台。 总而言之,bugku s1 awd排位赛-12是一个让参赛者在攻击和防御中展示自己技术的平台,并提供了一个促进交流和学习的机会。通过这样的比赛,可以推动网络安全领域的发展,培养更多优秀的安全人才。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值