QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#544787#7868. 天空度假山庄ASnown45 30ms3968kbC++141.0kb2024-09-02 20:15:412024-09-02 20:15:41

Judging History

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

  • [2024-09-02 20:15:41]
  • 评测
  • 测评结果:45
  • 用时:30ms
  • 内存:3968kb
  • [2024-09-02 20:15:41]
  • 提交

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+13+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("");
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 5
Accepted

Test #1:

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

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: 3968kb

input:

5166 2

output:

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

result:

ok correct

Test #3:

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

input:

7445 2

output:

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

result:

ok correct

Test #4:

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

input:

1295 2

output:

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

result:

ok correct

Subtask #2:

score: 20
Accepted

Test #5:

score: 20
Accepted
time: 22ms
memory: 3840kb

input:

86132 9

output:

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

result:

ok correct

Test #6:

score: 20
Accepted
time: 30ms
memory: 3760kb

input:

73452 11

output:

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

result:

ok correct

Test #7:

score: 20
Accepted
time: 12ms
memory: 3824kb

input:

23283 20

output:

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

result:

ok correct

Test #8:

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

input:

36944 17

output:

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

result:

ok correct

Test #9:

score: 20
Accepted
time: 24ms
memory: 3852kb

input:

61927 10

output:

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

result:

ok correct

Subtask #3:

score: 20
Accepted

Dependency #2:

100%
Accepted

Test #10:

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

input:

111 17

output:

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

result:

ok correct

Test #11:

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

input:

462 86

output:

100 2 102 1 104 2 106 1 108 2 110 1 112 2 114 1 116 2 118 1 120 2 122 1 124 2 126 1 128 2 130 1 132 2 134 1 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 101 3 103 2 105 3 107 2 109 3 111 2 113 3 ...

result:

ok correct

Test #12:

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

input:

262 43

output:

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

result:

ok correct

Test #13:

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

input:

672 125

output:

139 2 141 1 143 2 145 1 147 2 149 1 151 2 153 1 155 2 157 1 159 2 161 1 163 2 165 1 167 2 169 1 171 2 173 1 175 2 177 1 179 2 181 1 183 2 185 1 187 2 189 1 191 2 193 1 195 2 197 1 199 2 201 1 203 2 205 1 207 2 209 1 211 2 213 1 215 2 217 1 219 2 221 1 223 2 225 1 227 2 229 1 231 2 233 1 235 2 237 1 ...

result:

ok correct

Test #14:

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

input:

747 127

output:

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 225 2 227 1 229 2 231 1 233 2 235 1 237 2 239 1 ...

result:

ok correct

Test #15:

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

input:

404 72

output:

86 2 88 1 90 2 92 1 94 2 96 1 98 2 100 1 102 2 104 1 106 2 108 1 110 2 112 1 114 2 116 1 118 2 120 1 122 2 124 1 126 2 128 1 130 2 132 1 134 2 136 1 138 2 140 1 142 2 144 1 146 2 148 1 150 2 152 1 154 156 1 2 87 3 89 2 91 3 93 2 95 3 97 2 99 3 101 2 103 3 105 2 107 3 109 2 111 3 113 2 115 3 117 2 11...

result:

ok correct

Subtask #4:

score: 0
Wrong Answer

Test #16:

score: 20
Accepted
time: 11ms
memory: 3908kb

input:

1777 229

output:

243 2 245 1 247 2 249 1 251 2 253 1 255 2 257 1 259 2 261 1 263 2 265 1 267 2 269 1 271 2 273 1 275 2 277 1 279 2 281 1 283 2 285 1 287 2 289 1 291 2 293 1 295 2 297 1 299 2 301 1 303 2 305 1 307 2 309 1 311 2 313 1 315 2 317 1 319 2 321 1 323 2 325 1 327 2 329 1 331 2 333 1 335 2 337 1 339 2 341 1 ...

result:

ok correct

Test #17:

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

input:

1129 229

output:

243 2 245 1 247 2 249 1 251 2 253 1 255 2 257 1 259 2 261 1 263 2 265 1 267 2 269 1 271 2 273 1 275 2 277 1 279 2 281 1 283 2 285 1 287 2 289 1 291 2 293 1 295 2 297 1 299 2 301 1 303 2 305 1 307 2 309 1 311 2 313 1 315 2 317 1 319 2 321 1 323 2 325 1 327 2 329 1 331 2 333 1 335 2 337 1 339 2 341 1 ...

result:

ok correct

Test #18:

score: 20
Accepted
time: 28ms
memory: 3772kb

input:

4253 233

output:

247 2 249 1 251 2 253 1 255 2 257 1 259 2 261 1 263 2 265 1 267 2 269 1 271 2 273 1 275 2 277 1 279 2 281 1 283 2 285 1 287 2 289 1 291 2 293 1 295 2 297 1 299 2 301 1 303 2 305 1 307 2 309 1 311 2 313 1 315 2 317 1 319 2 321 1 323 2 325 1 327 2 329 1 331 2 333 1 335 2 337 1 339 2 341 1 343 2 345 1 ...

result:

ok correct

Test #19:

score: 20
Accepted
time: 14ms
memory: 3776kb

input:

2311 233

output:

247 2 249 1 251 2 253 1 255 2 257 1 259 2 261 1 263 2 265 1 267 2 269 1 271 2 273 1 275 2 277 1 279 2 281 1 283 2 285 1 287 2 289 1 291 2 293 1 295 2 297 1 299 2 301 1 303 2 305 1 307 2 309 1 311 2 313 1 315 2 317 1 319 2 321 1 323 2 325 1 327 2 329 1 331 2 333 1 335 2 337 1 339 2 341 1 343 2 345 1 ...

result:

ok correct

Test #20:

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

input:

6712 114

output:

128 2 130 1 132 2 134 1 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 ...

result:

ok correct

Test #21:

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

input:

1050 114

output:

128 2 130 1 132 2 134 1 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 ...

result:

ok correct

Test #22:

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

input:

1132 514

output:

528 2 530 1 532 2 534 1 536 2 538 1 540 2 542 1 544 2 546 1 548 2 550 1 552 2 554 1 556 2 558 1 560 2 562 1 564 2 566 1 568 2 570 1 572 2 574 1 576 2 578 1 580 2 582 1 584 2 586 1 588 2 590 1 592 2 594 1 596 2 598 1 600 2 602 1 604 2 606 1 608 2 610 1 612 2 614 1 616 2 618 1 620 2 622 1 624 2 626 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%