0
点赞
收藏
分享

微信扫一扫

Codeforces Round #185 (Div. 1) / 311A The Closest Pair (“陷阱”题)


http://codeforces.com/problemset/problem/311/A


tot will be up to 

Codeforces Round #185 (Div. 1) / 311A The Closest Pair (“陷阱”题)_C++

.

d ≤ p[j].x - p[i].x is always false. The obvious way is to make all points' x coordinates the same(WTF!!!). And we can just choose n

Thus the problem is solved.



#include<cstdio>

int main()
{
	int n, k;
	scanf("%d%d", &n, &k);
	if (k >= n * (n - 1) / 2) puts("no solution");
	else for (int i = 1; i <= n; i++) printf("0 %d\n", i);
	return 0;
}


【扩展】

如果要求每个x的横坐标都不相同呢?

举报

相关推荐

0 条评论