Processing math: 100%

SPS的格子 【构造】

tonyfang posted @ 2016年9月15日 09:50 in CodeForces with tags c++ OI , 993 阅读

【题目描述】

SPS有n个格子,现在他要让你对这n个格子染色,每个格子可以染色成0~9。

因为SPS希望完美,所以他想,如果a+b=c,那么如果格子a与格子b颜色相同,那么格子c与格子a颜色就不能相同。

请你构造出方案。

30:n2101

60:n3101

100:n25000

【题解】

题目来源:2016-2017 CT S03E02: Codeforces Trainings Season 3 Episode 2 Problem I

当时比赛属于全程懵逼状态。

首先n2101可以用暴力得出结果。

 

然后黄文翰学长提供了一种康托三分集的思想。

具体就是类似于这样

121333121444444444121333121555555555555555555555555555....

是一种分形构造。很明显满足题目要求,这样就能过60%的数据啦!

 

然后今天早上起来,cf上有人给了一种新的构造方法,能通过本题。

excited!!!

这样就有满分啦!

 

10th Question Paper 说:
2023年2月11日 18:23

10th Question Paper 2024 is Get Available by the Board of Secondary Education. The Model Question Paper for class 10th will deliver in online mode on the authority site. The Model Paper will comprise of the subject-wise New Question Paper, day, timings, 10th Question Paper 2024 and significant guidelines for test day. In this article, the up-and-comer will get the data about the 10th Class Latest Question Paper 2024 including delivering PDF and how to download the Latest Question Paper.


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter