QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#544795 | #7868. 天空度假山庄 | ASnown | 45 | 29ms | 3916kb | C++14 | 1.0kb | 2024-09-02 20:17:17 | 2024-09-02 20:17:17 |
Judging History
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+12+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: 0ms
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: 3800kb
input:
5166 2
output:
15 2 16 3 17 4 18 5 19 6 20 7 21 8 22 9 23 10 24 11 25 12 26 13 27 14 28 15 29 16 30 17 31 18 32 19 33 20 34 21 35 22 36 23 37 24 38 25 39 26 40 27 41 28 42 29 43 30 44 31 45 32 46 33 47 34 48 35 49 36 50 37 51 38 52 39 53 40 54 41 55 42 56 43 57 44 58 45 59 46 60 47 61 48 62 49 63 50 64 51 65 52 66...
result:
ok correct
Test #3:
score: 5
Accepted
time: 1ms
memory: 3868kb
input:
7445 2
output:
15 2 16 3 17 4 18 5 19 6 20 7 21 8 22 9 23 10 24 11 25 12 26 13 27 14 28 15 29 16 30 17 31 18 32 19 33 20 34 21 35 22 36 23 37 24 38 25 39 26 40 27 41 28 42 29 43 30 44 31 45 32 46 33 47 34 48 35 49 36 50 37 51 38 52 39 53 40 54 41 55 42 56 43 57 44 58 45 59 46 60 47 61 48 62 49 63 50 64 51 65 52 66...
result:
ok correct
Test #4:
score: 5
Accepted
time: 0ms
memory: 3836kb
input:
1295 2
output:
15 2 16 3 17 4 18 5 19 6 20 7 21 8 22 9 23 10 24 11 25 12 26 13 27 14 28 15 29 16 30 17 31 18 32 19 33 20 34 21 35 22 36 23 37 24 38 25 39 26 40 27 41 28 42 29 43 30 44 31 45 32 46 33 47 34 48 35 49 36 50 37 51 38 52 39 53 40 54 41 55 42 56 43 57 44 58 45 59 46 60 47 61 48 62 49 63 50 64 51 65 52 66...
result:
ok correct
Subtask #2:
score: 20
Accepted
Test #5:
score: 20
Accepted
time: 25ms
memory: 3848kb
input:
86132 9
output:
22 2 24 1 26 2 28 1 2 23 3 25 2 27 3 29 2 3 24 4 26 3 28 4 30 3 4 25 5 27 4 29 5 31 4 5 26 6 28 5 30 6 32 5 6 27 7 29 6 31 7 33 6 7 28 8 30 7 32 8 34 7 8 29 9 31 8 33 9 35 8 9 30 10 32 9 34 10 36 9 10 31 11 33 10 35 11 37 10 11 32 12 34 11 36 12 38 11 12 33 13 35 12 37 13 39 12 13 34 14 36 13 38 14 ...
result:
ok correct
Test #6:
score: 20
Accepted
time: 26ms
memory: 3916kb
input:
73452 11
output:
24 2 26 1 28 2 30 1 32 34 2 25 3 27 2 29 3 31 2 33 35 3 26 4 28 3 30 4 32 3 34 36 4 27 5 29 4 31 5 33 4 35 37 5 28 6 30 5 32 6 34 5 36 38 6 29 7 31 6 33 7 35 6 37 39 7 30 8 32 7 34 8 36 7 38 40 8 31 9 33 8 35 9 37 8 39 41 9 32 10 34 9 36 10 38 9 40 42 10 33 11 35 10 37 11 39 10 41 43 11 34 12 36 11 ...
result:
ok correct
Test #7:
score: 20
Accepted
time: 16ms
memory: 3856kb
input:
23283 20
output:
33 2 35 1 37 2 39 1 41 2 43 1 45 2 47 1 49 51 1 2 34 3 36 2 38 3 40 2 42 3 44 2 46 3 48 2 50 52 2 3 35 4 37 3 39 4 41 3 43 4 45 3 47 4 49 3 51 53 3 4 36 5 38 4 40 5 42 4 44 5 46 4 48 5 50 4 52 54 4 5 37 6 39 5 41 6 43 5 45 6 47 5 49 6 51 5 53 55 5 6 38 7 40 6 42 7 44 6 46 7 48 6 50 7 52 6 54 56 6 7 ...
result:
ok correct
Test #8:
score: 20
Accepted
time: 19ms
memory: 3840kb
input:
36944 17
output:
30 2 32 1 34 2 36 1 38 2 40 1 42 2 44 1 2 31 3 33 2 35 3 37 2 39 3 41 2 43 3 45 2 3 32 4 34 3 36 4 38 3 40 4 42 3 44 4 46 3 4 33 5 35 4 37 5 39 4 41 5 43 4 45 5 47 4 5 34 6 36 5 38 6 40 5 42 6 44 5 46 6 48 5 6 35 7 37 6 39 7 41 6 43 7 45 6 47 7 49 6 7 36 8 38 7 40 8 42 7 44 8 46 7 48 8 50 7 8 37 9 3...
result:
ok correct
Test #9:
score: 20
Accepted
time: 19ms
memory: 3908kb
input:
61927 10
output:
23 2 25 1 27 2 29 1 31 2 24 3 26 2 28 3 30 2 32 3 25 4 27 3 29 4 31 3 33 4 26 5 28 4 30 5 32 4 34 5 27 6 29 5 31 6 33 5 35 6 28 7 30 6 32 7 34 6 36 7 29 8 31 7 33 8 35 7 37 8 30 9 32 8 34 9 36 8 38 9 31 10 33 9 35 10 37 9 39 10 32 11 34 10 36 11 38 10 40 11 33 12 35 11 37 12 39 11 41 12 34 13 36 12 ...
result:
ok correct
Subtask #3:
score: 20
Accepted
Dependency #2:
100%
Accepted
Test #10:
score: 20
Accepted
time: 1ms
memory: 3796kb
input:
111 17
output:
30 2 32 1 34 2 36 1 38 2 40 1 42 2 44 1 2 31 3 33 2 35 3 37 2 39 3 41 2 43 3 45 2 3 32 4 34 3 36 4 38 3 40 4 42 3 44 4 46 3 4 33 5 35 4 37 5 39 4 41 5 43 4 45 5 47 4 5 34 6 36 5 38 6 40 5 42 6 44 5 46 6 48 5 6 35 7 37 6 39 7 41 6 43 7 45 6 47 7 49 6 7 36 8 38 7 40 8 42 7 44 8 46 7 48 8 50 7 8 37 9 3...
result:
ok correct
Test #11:
score: 20
Accepted
time: 2ms
memory: 3788kb
input:
462 86
output:
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 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 100 3 102 2 104 3 106 2 108 3 110 2 112 3 1...
result:
ok correct
Test #12:
score: 20
Accepted
time: 1ms
memory: 3872kb
input:
262 43
output:
56 2 58 1 60 2 62 1 64 2 66 1 68 2 70 1 72 2 74 1 76 2 78 1 80 2 82 1 84 2 86 1 88 2 90 1 92 2 94 1 96 98 2 57 3 59 2 61 3 63 2 65 3 67 2 69 3 71 2 73 3 75 2 77 3 79 2 81 3 83 2 85 3 87 2 89 3 91 2 93 3 95 2 97 99 3 58 4 60 3 62 4 64 3 66 4 68 3 70 4 72 3 74 4 76 3 78 4 80 3 82 4 84 3 86 4 88 3 90 4...
result:
ok correct
Test #13:
score: 20
Accepted
time: 3ms
memory: 3808kb
input:
672 125
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 #14:
score: 20
Accepted
time: 3ms
memory: 3852kb
input:
747 127
output:
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 236 2 238 1 ...
result:
ok correct
Test #15:
score: 20
Accepted
time: 1ms
memory: 3804kb
input:
404 72
output:
85 2 87 1 89 2 91 1 93 2 95 1 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 155 1 2 86 3 88 2 90 3 92 2 94 3 96 2 98 3 100 2 102 3 104 2 106 3 108 2 110 3 112 2 114 3 116 2 118...
result:
ok correct
Subtask #4:
score: 0
Wrong Answer
Test #16:
score: 20
Accepted
time: 10ms
memory: 3872kb
input:
1777 229
output:
242 2 244 1 246 2 248 1 250 2 252 1 254 2 256 1 258 2 260 1 262 2 264 1 266 2 268 1 270 2 272 1 274 2 276 1 278 2 280 1 282 2 284 1 286 2 288 1 290 2 292 1 294 2 296 1 298 2 300 1 302 2 304 1 306 2 308 1 310 2 312 1 314 2 316 1 318 2 320 1 322 2 324 1 326 2 328 1 330 2 332 1 334 2 336 1 338 2 340 1 ...
result:
ok correct
Test #17:
score: 20
Accepted
time: 9ms
memory: 3848kb
input:
1129 229
output:
242 2 244 1 246 2 248 1 250 2 252 1 254 2 256 1 258 2 260 1 262 2 264 1 266 2 268 1 270 2 272 1 274 2 276 1 278 2 280 1 282 2 284 1 286 2 288 1 290 2 292 1 294 2 296 1 298 2 300 1 302 2 304 1 306 2 308 1 310 2 312 1 314 2 316 1 318 2 320 1 322 2 324 1 326 2 328 1 330 2 332 1 334 2 336 1 338 2 340 1 ...
result:
ok correct
Test #18:
score: 20
Accepted
time: 29ms
memory: 3808kb
input:
4253 233
output:
246 2 248 1 250 2 252 1 254 2 256 1 258 2 260 1 262 2 264 1 266 2 268 1 270 2 272 1 274 2 276 1 278 2 280 1 282 2 284 1 286 2 288 1 290 2 292 1 294 2 296 1 298 2 300 1 302 2 304 1 306 2 308 1 310 2 312 1 314 2 316 1 318 2 320 1 322 2 324 1 326 2 328 1 330 2 332 1 334 2 336 1 338 2 340 1 342 2 344 1 ...
result:
ok correct
Test #19:
score: 20
Accepted
time: 18ms
memory: 3852kb
input:
2311 233
output:
246 2 248 1 250 2 252 1 254 2 256 1 258 2 260 1 262 2 264 1 266 2 268 1 270 2 272 1 274 2 276 1 278 2 280 1 282 2 284 1 286 2 288 1 290 2 292 1 294 2 296 1 298 2 300 1 302 2 304 1 306 2 308 1 310 2 312 1 314 2 316 1 318 2 320 1 322 2 324 1 326 2 328 1 330 2 332 1 334 2 336 1 338 2 340 1 342 2 344 1 ...
result:
ok correct
Test #20:
score: 20
Accepted
time: 22ms
memory: 3872kb
input:
6712 114
output:
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 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 ...
result:
ok correct
Test #21:
score: 20
Accepted
time: 4ms
memory: 3864kb
input:
1050 114
output:
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 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 ...
result:
ok correct
Test #22:
score: 0
Wrong Answer
time: 15ms
memory: 3872kb
input:
1132 514
output:
527 2 529 1 531 2 533 1 535 2 537 1 539 2 541 1 543 2 545 1 547 2 549 1 551 2 553 1 555 2 557 1 559 2 561 1 563 2 565 1 567 2 569 1 571 2 573 1 575 2 577 1 579 2 581 1 583 2 585 1 587 2 589 1 591 2 593 1 595 2 597 1 599 2 601 1 603 2 605 1 607 2 609 1 611 2 613 1 615 2 617 1 619 2 621 1 623 2 625 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%