2023江西省赛

A

int main() {
#ifndef ONLINE_JUDGE
	freopen("test.in","r",stdin);
#endif

	int T;
	cin>>T;
	while(T--) {
		int N,S,V;
		cin>>N>>S>>V;
		cout<<"01"[N<=S*V]<<al;
	}

    return 0;
}

 B

int main() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
#ifndef ONLINE_JUDGE
	freopen("test.in","r",stdin);
#endif

	int k;
	cin>>k;
	vector<ll>a(k);
	int i;
	fz0k(i,k) {
		cin>>a[i];
	}
	ll n,m,x;
	cin>>n>>m>>x;
	x%=m;
	ll jyl=0;
	fz0k(i,k) {
		a[i]%=m;
		jyl+=a[i];
	}
	//求b[n]/m
	ll bn=x+jyl*(n/k);
	fz0k(i,n%k) {
		bn+=a[i];
	}
	cout<<n-bn/m<<al;

    return 0;
}

C

int main() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
#ifndef ONLINE_JUDGE
	freopen("test.in","r",stdin);
#endif

	ll n,p;
	cin>>n>>p;
	vector<ll>a(n);
	int i;
	fz0k(i,n) {
		cin>>a[i];
	}
	int wwx=0;
	if(p&1) {
		fz0k(i,n) {
			wwx^=a[i]&1;
		}
	}
	else {
		fz0k(i,n) {
			a[i]%=p+1;
			if(a[i]==p) {
				wwx^=2;
			}
			else {
				wwx^=a[i]&1;
			}
		}
	}
	if(wwx==0) {
		cout<<"BAD"<<al;
	}
	else {
		cout<<"GOOD"<<al;
	}

    return 0;
}

I

int main() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
#ifndef ONLINE_JUDGE
	freopen("test.in","r",stdin);
#endif

	int i;
	int n,q;
	cin>>n>>q;
	vector<int> a(n+1);
	fz1(i,n-1) {
		int x,y,w;
		cin>>x>>y>>w;
		a[x]^=w;
		a[y]^=w;
	}
	while(q--) {
		int opt,x,y,w;
		cin>>opt;
		if(opt==2) {
			cin>>x;
			cout<<a[x]<<al;
		}
		else {
			cin>>x>>y>>w;
			a[x]^=w;
			a[y]^=w;
		}
	}

    return 0;
}

J

int main() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
#ifndef ONLINE_JUDGE
	freopen("test.in","r",stdin);
#endif
	
	int i;
	int n;
	cin>>n;
	vector<int>b(n+1);
	fz1(i,n) {
		cin>>b[i];
	}
	auto sqr=[](const int x) {
		return x*x;
	};
	int m;
	cin>>m;
	while(m--) {
		int opt,a,b1;
		cin>>opt;
		if(opt==1) {
			cin>>a;
			int oo=sqrt(b[a]);
			int wwx=iinf;
			fz(i,max(1,a-oo),min(n,a+oo)) {
				wwx=min(wwx,sqr(a-i)+b[i]);
			}
			cout<<wwx<<al;
		}
		else {
			cin>>a>>b1;
			b[a]=min(b[a],b1);
		}
	}

    return 0;
}

K

int main() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
#ifndef ONLINE_JUDGE
	freopen("test.in","r",stdin);
#endif

	int n,m;
	cin>>n;
	vector<int>a(n);
	int i;
	fz0k(i,n) {
		cin>>a[i];
	}
	vector<int>b(n);
	fz0k(i,n-1) {
		b[i]=a[i]-a[i+1];
	}
	sort(b.begin(),b.end(),[](CI pp,CI qq) {
		return pp>qq;
	});
	fz(i,1,(int)(b.size()-1)) {
		b[i]+=b[i-1];
	}
	cin>>m;
	while(m--) {
		int opt,x;
		cin>>opt>>x;
		if(opt==1) {
			if(x>1) {
				cout<<a[0]-a[n-1]-b[x-2]<<al;
			}
			else {
				cout<<a[0]-a[n-1]<<al;
			}
		}
	}

    return 0;
}

 L

int main() {
#ifndef ONLINE_JUDGE
	freopen("test.in","r",stdin);
#endif

	auto n=0;
	cin>>n;
	cout<<n-1<<endl;

    return 0;
}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值