首页 > 其他 > 详细

Codeforces Round #674 (Div. 3)

时间:2020-09-29 13:18:43      阅读:67      评论:0      收藏:0      [点我收藏+]

A题

技术分享图片

#include <bits/stdc++.h>
using namespace std;
int main () {
	int t;
	cin >> t;
	while(t--) {
		int n, x;
		cin >> n >> x;
		int ans = 0;
		for(int i = 0; i < n; ) {
			i = ans * x + 2;
			ans++;
		}
		cout << ans << endl;
	}
} 

 B题

技术分享图片

 

 

#include <bits/stdc++.h>
using namespace std;
int main () {
	int t;
	cin >> t;
	while(t--) {
		bool ok = 0;
		int n, m;
		cin >> n >> m;
		for(int i = 0; i < n; ++i) {
			int x1, x2, y1, y2;
			cin >> x1 >> x2 >> y1 >> y2;
			if(x2 == y1) {
				ok = 1;
			}
		}
		if(ok && m % 2 == 0) {
			cout << "YES" << endl;
		}
		else {
			cout << "NO" << endl;
		}
	}
} 

 

Codeforces Round #674 (Div. 3)

原文:https://www.cnblogs.com/lightac/p/13748586.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!