QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#374521#5275. Joking?zhouhuanyiAC ✓0ms3792kbC++141.8kb2024-04-02 14:54:112024-04-02 14:54:12

Judging History

你现在查看的是最新测评结果

  • [2024-04-02 14:54:12]
  • 评测
  • 测评结果:AC
  • 用时:0ms
  • 内存:3792kb
  • [2024-04-02 14:54:11]
  • 提交

answer

#include<iostream>
#include<cstdio>
#include<algorithm>
#define N 600
using namespace std;
int read()
{
	char c=0;
	int sum=0;
	while (c<'0'||c>'9') c=getchar();
	while ('0'<=c&&c<='9') sum=sum*10+c-'0',c=getchar();
	return sum;
}
int n,delta[N+1]={0,3,1,2,5,4,3,4,1,2,5,4,2,3,5,1,3,5,2,4,1,4,5,2,1,3,1,4,5,3,2,2,4,1,5,3,5,1,4,2,3,1,3,2,5,4,5,2,4,3,1,2,3,5,1,4,1,5,4,2,3,3,2,4,5,1,5,2,1,3,4,1,3,5,4,2,5,4,3,1,2,2,5,1,4,3,1,5,3,2,4,2,3,4,1,5,1,2,5,3,4,1,4,5,2,3,1,4,3,2,5,3,1,4,2,5,3,4,5,2,1,5,4,2,1,3,3,1,2,4,5,2,4,5,1,3,1,2,4,5,3,4,5,2,3,1,3,2,5,1,4,2,4,5,3,1,3,4,1,5,2,3,4,2,5,1,4,3,5,2,1,3,5,4,1,2,1,5,2,3,4,4,3,5,1,2,2,5,4,1,3,4,3,1,5,2,4,3,2,5,1,1,2,3,5,4,4,2,1,5,3,5,2,4,1,3,1,4,3,5,2,4,1,5,3,2,2,1,3,5,4,1,5,3,4,2,5,1,4,3,2,5,3,2,4,1,3,4,2,1,5,5,2,3,4,1,5,1,3,4,2,2,1,5,4,3,4,1,5,2,3,1,2,3,4,5,5,4,2,3,1,3,5,1,2,4,1,3,2,4,5,2,3,1,5,4,3,1,5,4,2,4,2,5,3,1,5,4,1,2,3,2,1,4,3,5,3,2,1,5,4,5,3,1,2,4,2,3,1,4,5,4,5,3,1,2,2,5,4,3,1,1,3,4,2,5,3,2,1,4,5,1,2,4,3,5,2,3,4,5,1,2,1,4,5,3,3,5,2,1,4,5,3,1,4,2,2,3,5,4,1,5,2,3,1,4,2,4,3,1,5,4,1,2,5,3,4,2,5,1,3,3,1,5,2,4,5,4,3,2,1,4,1,3,5,2,4,2,1,3,5,5,1,3,2,4,3,2,5,4,1,1,2,5,4,3,3,5,4,2,1,1,5,4,3,2,1,4,2,5,3,4,1,2,3,5,2,5,1,3,4,3,4,5,1,2,1,4,2,3,5,1,3,5,2,4,4,5,1,3,2,4,5,1,2,3,5,2,1,4,3,5,3,4,2,1,4,3,2,1,5,5,1,2,4,3,5,3,4,1,2,5,4,1,3,2,3,2,4,1,5,3,1,4,5,2,2,1,3,4,5,4,1,3,2,5,2,5,3,4,1,5,1,2,3,4,3,5,1,4,2,2,4,1,3,5,4,2,3,1,5,2,5,3,1,4,4,5,3,2,1,2,4,3,5,1,1,5,2,4,3,4,3,1,2,5,5,3,2,1,4,1,3,4,5,2,2,1,5,3,4},num[N+1];
bool used[N+1];
int main()
{
	n=read();
	for (int i=1;i<=n;++i)
		for (int j=1;j<=N;++j)
			if (delta[j]==i)
				used[j]=1;
	for (int i=1;i<=N;++i) num[i]=num[i-1]+used[i];
	puts("120");
	for (int i=1;i<=n;++i)
	{
		for (int j=1;j<=N;++j)
			if (delta[j]==i)
				printf("%d ",num[j]);
		puts("");
	}
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3736kb

input:

2

output:

120
1 3 6 8 10 11 14 15 17 20 22 23 26 28 29 31 34 35 38 39 41 43 45 48 50 51 54 55 58 60 62 63 66 68 69 71 73 76 77 80 81 84 86 87 89 92 93 95 98 100 102 103 106 107 109 112 113 115 118 119 122 123 126 128 129 132 133 136 137 140 141 144 146 148 149 152 154 156 157 160 161 164 165 168 169 172 173 1...

result:

ok n = 2, max_relative_diff = 0.000%

Test #2:

score: 0
Accepted
time: 0ms
memory: 3792kb

input:

3

output:

120
2 5 9 12 14 16 20 22 25 30 33 34 39 41 43 47 50 52 57 58 61 64 68 72 74 77 80 82 87 90 93 95 99 102 104 106 110 113 116 120 121 125 128 130 133 137 139 142 147 150 153 154 158 160 163 168 170 172 177 179 183 184 188 192 194 198 200 204 205 210 211 216 218 222 224 228 231 234 235 239 242 246 247 ...

result:

ok n = 3, max_relative_diff = 0.005%

Test #3:

score: 0
Accepted
time: 0ms
memory: 3776kb

input:

4

output:

120
2 7 12 16 19 21 27 29 33 40 43 45 52 54 57 63 66 69 76 77 81 85 90 96 99 102 107 109 116 119 124 127 132 136 139 141 147 151 155 160 161 167 171 173 178 182 185 189 196 200 204 205 210 214 217 224 226 229 235 238 244 246 250 255 258 263 267 272 273 279 281 288 290 295 298 304 307 312 314 319 322...

result:

ok n = 4, max_relative_diff = 0.012%

Test #4:

score: 0
Accepted
time: 0ms
memory: 3788kb

input:

5

output:

120
2 8 15 20 24 26 33 37 41 50 54 56 65 68 71 79 83 86 94 96 101 106 112 120 124 127 134 136 145 149 155 158 165 170 174 176 184 189 193 200 201 208 214 216 222 227 231 237 245 249 255 257 262 267 271 280 283 286 293 297 305 308 312 318 323 328 334 340 341 348 351 360 362 369 373 380 384 389 392 39...

result:

ok n = 5, max_relative_diff = 0.060%