QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#544805#7868. 天空度假山庄ASnown45 33ms3916kbC++141.0kb2024-09-02 20:20:122024-09-02 20:20:13

Judging History

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

  • [2024-09-02 20:20:13]
  • 评测
  • 测评结果:45
  • 用时:33ms
  • 内存:3916kb
  • [2024-09-02 20:20:12]
  • 提交

answer

#include<bits/stdc++.h>
#define file(F) freopen(#F".in","r",stdin),freopen(#F".out","w",stdout)
#define lowbit(x) ((x)&-(x))
#define ALL(x) x.begin(),x.end()
#define debug(...) fprintf(stderr,__VA_ARGS__)
using namespace std;
using ll=long long;
template<typename T>
inline bool Max(T &x,T y) { return std::less<T>()(x,y)&&(x=y,true); }
template<typename T>
inline bool Min(T &x,T y) { return std::less<T>()(y,x)&&(x=y,true); }
void Solve();
int n,m;
inline int num(int x) { return (x-1)%n+1; }
signed main() {
#ifndef ONLINE_JUDGE
#endif
   cin.tie(nullptr)->sync_with_stdio(false);
   Solve();
}
void Solve() {
   cin>>n>>m;
   for(int i=1;i<n;i++) {
      int k=m,j=num(i+10+k);
      for(;k>4;k-=4,j=num(j+4))
         printf("%d %d %d %d ",j,i+1,num(j+2),i);
      switch(k) {
      case 1: printf("%d ",i+1); break;
      case 2: printf("%d %d ",j,i+1); break;
      case 3: printf("%d %d %d ",j,num(j+2),i+1); break;
      case 4: printf("%d %d %d %d ",j,num(j+2),i,i+1); break;
      }
   } puts("");
}

详细

Subtask #1:

score: 5
Accepted

Test #1:

score: 5
Accepted
time: 1ms
memory: 3872kb

input:

8216 1

output:

2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 10...

result:

ok correct

Test #2:

score: 5
Accepted
time: 1ms
memory: 3860kb

input:

5166 2

output:

13 2 14 3 15 4 16 5 17 6 18 7 19 8 20 9 21 10 22 11 23 12 24 13 25 14 26 15 27 16 28 17 29 18 30 19 31 20 32 21 33 22 34 23 35 24 36 25 37 26 38 27 39 28 40 29 41 30 42 31 43 32 44 33 45 34 46 35 47 36 48 37 49 38 50 39 51 40 52 41 53 42 54 43 55 44 56 45 57 46 58 47 59 48 60 49 61 50 62 51 63 52 64...

result:

ok correct

Test #3:

score: 5
Accepted
time: 0ms
memory: 3916kb

input:

7445 2

output:

13 2 14 3 15 4 16 5 17 6 18 7 19 8 20 9 21 10 22 11 23 12 24 13 25 14 26 15 27 16 28 17 29 18 30 19 31 20 32 21 33 22 34 23 35 24 36 25 37 26 38 27 39 28 40 29 41 30 42 31 43 32 44 33 45 34 46 35 47 36 48 37 49 38 50 39 51 40 52 41 53 42 54 43 55 44 56 45 57 46 58 47 59 48 60 49 61 50 62 51 63 52 64...

result:

ok correct

Test #4:

score: 5
Accepted
time: 1ms
memory: 3788kb

input:

1295 2

output:

13 2 14 3 15 4 16 5 17 6 18 7 19 8 20 9 21 10 22 11 23 12 24 13 25 14 26 15 27 16 28 17 29 18 30 19 31 20 32 21 33 22 34 23 35 24 36 25 37 26 38 27 39 28 40 29 41 30 42 31 43 32 44 33 45 34 46 35 47 36 48 37 49 38 50 39 51 40 52 41 53 42 54 43 55 44 56 45 57 46 58 47 59 48 60 49 61 50 62 51 63 52 64...

result:

ok correct

Subtask #2:

score: 20
Accepted

Test #5:

score: 20
Accepted
time: 26ms
memory: 3784kb

input:

86132 9

output:

20 2 22 1 24 2 26 1 2 21 3 23 2 25 3 27 2 3 22 4 24 3 26 4 28 3 4 23 5 25 4 27 5 29 4 5 24 6 26 5 28 6 30 5 6 25 7 27 6 29 7 31 6 7 26 8 28 7 30 8 32 7 8 27 9 29 8 31 9 33 8 9 28 10 30 9 32 10 34 9 10 29 11 31 10 33 11 35 10 11 30 12 32 11 34 12 36 11 12 31 13 33 12 35 13 37 12 13 32 14 34 13 36 14 ...

result:

ok correct

Test #6:

score: 20
Accepted
time: 25ms
memory: 3856kb

input:

73452 11

output:

22 2 24 1 26 2 28 1 30 32 2 23 3 25 2 27 3 29 2 31 33 3 24 4 26 3 28 4 30 3 32 34 4 25 5 27 4 29 5 31 4 33 35 5 26 6 28 5 30 6 32 5 34 36 6 27 7 29 6 31 7 33 6 35 37 7 28 8 30 7 32 8 34 7 36 38 8 29 9 31 8 33 9 35 8 37 39 9 30 10 32 9 34 10 36 9 38 40 10 31 11 33 10 35 11 37 10 39 41 11 32 12 34 11 ...

result:

ok correct

Test #7:

score: 20
Accepted
time: 17ms
memory: 3864kb

input:

23283 20

output:

31 2 33 1 35 2 37 1 39 2 41 1 43 2 45 1 47 49 1 2 32 3 34 2 36 3 38 2 40 3 42 2 44 3 46 2 48 50 2 3 33 4 35 3 37 4 39 3 41 4 43 3 45 4 47 3 49 51 3 4 34 5 36 4 38 5 40 4 42 5 44 4 46 5 48 4 50 52 4 5 35 6 37 5 39 6 41 5 43 6 45 5 47 6 49 5 51 53 5 6 36 7 38 6 40 7 42 6 44 7 46 6 48 7 50 6 52 54 6 7 ...

result:

ok correct

Test #8:

score: 20
Accepted
time: 19ms
memory: 3836kb

input:

36944 17

output:

28 2 30 1 32 2 34 1 36 2 38 1 40 2 42 1 2 29 3 31 2 33 3 35 2 37 3 39 2 41 3 43 2 3 30 4 32 3 34 4 36 3 38 4 40 3 42 4 44 3 4 31 5 33 4 35 5 37 4 39 5 41 4 43 5 45 4 5 32 6 34 5 36 6 38 5 40 6 42 5 44 6 46 5 6 33 7 35 6 37 7 39 6 41 7 43 6 45 7 47 6 7 34 8 36 7 38 8 40 7 42 8 44 7 46 8 48 7 8 35 9 3...

result:

ok correct

Test #9:

score: 20
Accepted
time: 23ms
memory: 3864kb

input:

61927 10

output:

21 2 23 1 25 2 27 1 29 2 22 3 24 2 26 3 28 2 30 3 23 4 25 3 27 4 29 3 31 4 24 5 26 4 28 5 30 4 32 5 25 6 27 5 29 6 31 5 33 6 26 7 28 6 30 7 32 6 34 7 27 8 29 7 31 8 33 7 35 8 28 9 30 8 32 9 34 8 36 9 29 10 31 9 33 10 35 9 37 10 30 11 32 10 34 11 36 10 38 11 31 12 33 11 35 12 37 11 39 12 32 13 34 12 ...

result:

ok correct

Subtask #3:

score: 20
Accepted

Dependency #2:

100%
Accepted

Test #10:

score: 20
Accepted
time: 0ms
memory: 3860kb

input:

111 17

output:

28 2 30 1 32 2 34 1 36 2 38 1 40 2 42 1 2 29 3 31 2 33 3 35 2 37 3 39 2 41 3 43 2 3 30 4 32 3 34 4 36 3 38 4 40 3 42 4 44 3 4 31 5 33 4 35 5 37 4 39 5 41 4 43 5 45 4 5 32 6 34 5 36 6 38 5 40 6 42 5 44 6 46 5 6 33 7 35 6 37 7 39 6 41 7 43 6 45 7 47 6 7 34 8 36 7 38 8 40 7 42 8 44 7 46 8 48 7 8 35 9 3...

result:

ok correct

Test #11:

score: 20
Accepted
time: 2ms
memory: 3812kb

input:

462 86

output:

97 2 99 1 101 2 103 1 105 2 107 1 109 2 111 1 113 2 115 1 117 2 119 1 121 2 123 1 125 2 127 1 129 2 131 1 133 2 135 1 137 2 139 1 141 2 143 1 145 2 147 1 149 2 151 1 153 2 155 1 157 2 159 1 161 2 163 1 165 2 167 1 169 2 171 1 173 2 175 1 177 2 179 1 181 2 98 3 100 2 102 3 104 2 106 3 108 2 110 3 112...

result:

ok correct

Test #12:

score: 20
Accepted
time: 1ms
memory: 3868kb

input:

262 43

output:

54 2 56 1 58 2 60 1 62 2 64 1 66 2 68 1 70 2 72 1 74 2 76 1 78 2 80 1 82 2 84 1 86 2 88 1 90 2 92 1 94 96 2 55 3 57 2 59 3 61 2 63 3 65 2 67 3 69 2 71 3 73 2 75 3 77 2 79 3 81 2 83 3 85 2 87 3 89 2 91 3 93 2 95 97 3 56 4 58 3 60 4 62 3 64 4 66 3 68 4 70 3 72 4 74 3 76 4 78 3 80 4 82 3 84 4 86 3 88 4...

result:

ok correct

Test #13:

score: 20
Accepted
time: 3ms
memory: 3784kb

input:

672 125

output:

136 2 138 1 140 2 142 1 144 2 146 1 148 2 150 1 152 2 154 1 156 2 158 1 160 2 162 1 164 2 166 1 168 2 170 1 172 2 174 1 176 2 178 1 180 2 182 1 184 2 186 1 188 2 190 1 192 2 194 1 196 2 198 1 200 2 202 1 204 2 206 1 208 2 210 1 212 2 214 1 216 2 218 1 220 2 222 1 224 2 226 1 228 2 230 1 232 2 234 1 ...

result:

ok correct

Test #14:

score: 20
Accepted
time: 0ms
memory: 3844kb

input:

747 127

output:

138 2 140 1 142 2 144 1 146 2 148 1 150 2 152 1 154 2 156 1 158 2 160 1 162 2 164 1 166 2 168 1 170 2 172 1 174 2 176 1 178 2 180 1 182 2 184 1 186 2 188 1 190 2 192 1 194 2 196 1 198 2 200 1 202 2 204 1 206 2 208 1 210 2 212 1 214 2 216 1 218 2 220 1 222 2 224 1 226 2 228 1 230 2 232 1 234 2 236 1 ...

result:

ok correct

Test #15:

score: 20
Accepted
time: 2ms
memory: 3860kb

input:

404 72

output:

83 2 85 1 87 2 89 1 91 2 93 1 95 2 97 1 99 2 101 1 103 2 105 1 107 2 109 1 111 2 113 1 115 2 117 1 119 2 121 1 123 2 125 1 127 2 129 1 131 2 133 1 135 2 137 1 139 2 141 1 143 2 145 1 147 2 149 1 151 153 1 2 84 3 86 2 88 3 90 2 92 3 94 2 96 3 98 2 100 3 102 2 104 3 106 2 108 3 110 2 112 3 114 2 116 3...

result:

ok correct

Subtask #4:

score: 0
Wrong Answer

Test #16:

score: 20
Accepted
time: 10ms
memory: 3876kb

input:

1777 229

output:

240 2 242 1 244 2 246 1 248 2 250 1 252 2 254 1 256 2 258 1 260 2 262 1 264 2 266 1 268 2 270 1 272 2 274 1 276 2 278 1 280 2 282 1 284 2 286 1 288 2 290 1 292 2 294 1 296 2 298 1 300 2 302 1 304 2 306 1 308 2 310 1 312 2 314 1 316 2 318 1 320 2 322 1 324 2 326 1 328 2 330 1 332 2 334 1 336 2 338 1 ...

result:

ok correct

Test #17:

score: 20
Accepted
time: 9ms
memory: 3856kb

input:

1129 229

output:

240 2 242 1 244 2 246 1 248 2 250 1 252 2 254 1 256 2 258 1 260 2 262 1 264 2 266 1 268 2 270 1 272 2 274 1 276 2 278 1 280 2 282 1 284 2 286 1 288 2 290 1 292 2 294 1 296 2 298 1 300 2 302 1 304 2 306 1 308 2 310 1 312 2 314 1 316 2 318 1 320 2 322 1 324 2 326 1 328 2 330 1 332 2 334 1 336 2 338 1 ...

result:

ok correct

Test #18:

score: 20
Accepted
time: 33ms
memory: 3880kb

input:

4253 233

output:

244 2 246 1 248 2 250 1 252 2 254 1 256 2 258 1 260 2 262 1 264 2 266 1 268 2 270 1 272 2 274 1 276 2 278 1 280 2 282 1 284 2 286 1 288 2 290 1 292 2 294 1 296 2 298 1 300 2 302 1 304 2 306 1 308 2 310 1 312 2 314 1 316 2 318 1 320 2 322 1 324 2 326 1 328 2 330 1 332 2 334 1 336 2 338 1 340 2 342 1 ...

result:

ok correct

Test #19:

score: 20
Accepted
time: 18ms
memory: 3848kb

input:

2311 233

output:

244 2 246 1 248 2 250 1 252 2 254 1 256 2 258 1 260 2 262 1 264 2 266 1 268 2 270 1 272 2 274 1 276 2 278 1 280 2 282 1 284 2 286 1 288 2 290 1 292 2 294 1 296 2 298 1 300 2 302 1 304 2 306 1 308 2 310 1 312 2 314 1 316 2 318 1 320 2 322 1 324 2 326 1 328 2 330 1 332 2 334 1 336 2 338 1 340 2 342 1 ...

result:

ok correct

Test #20:

score: 20
Accepted
time: 25ms
memory: 3880kb

input:

6712 114

output:

125 2 127 1 129 2 131 1 133 2 135 1 137 2 139 1 141 2 143 1 145 2 147 1 149 2 151 1 153 2 155 1 157 2 159 1 161 2 163 1 165 2 167 1 169 2 171 1 173 2 175 1 177 2 179 1 181 2 183 1 185 2 187 1 189 2 191 1 193 2 195 1 197 2 199 1 201 2 203 1 205 2 207 1 209 2 211 1 213 2 215 1 217 2 219 1 221 2 223 1 ...

result:

ok correct

Test #21:

score: 20
Accepted
time: 4ms
memory: 3792kb

input:

1050 114

output:

125 2 127 1 129 2 131 1 133 2 135 1 137 2 139 1 141 2 143 1 145 2 147 1 149 2 151 1 153 2 155 1 157 2 159 1 161 2 163 1 165 2 167 1 169 2 171 1 173 2 175 1 177 2 179 1 181 2 183 1 185 2 187 1 189 2 191 1 193 2 195 1 197 2 199 1 201 2 203 1 205 2 207 1 209 2 211 1 213 2 215 1 217 2 219 1 221 2 223 1 ...

result:

ok correct

Test #22:

score: 0
Wrong Answer
time: 19ms
memory: 3848kb

input:

1132 514

output:

525 2 527 1 529 2 531 1 533 2 535 1 537 2 539 1 541 2 543 1 545 2 547 1 549 2 551 1 553 2 555 1 557 2 559 1 561 2 563 1 565 2 567 1 569 2 571 1 573 2 575 1 577 2 579 1 581 2 583 1 585 2 587 1 589 2 591 1 593 2 595 1 597 2 599 1 601 2 603 1 605 2 607 1 609 2 611 1 613 2 615 1 617 2 619 1 621 2 623 1 ...

result:

wrong answer visit same point several times.

Subtask #5:

score: 0
Skipped

Dependency #1:

100%
Accepted

Dependency #3:

100%
Accepted

Dependency #4:

0%