QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#551723 | #7868. 天空度假山庄 | ASnown | 5 | 20ms | 3864kb | C++14 | 1.0kb | 2024-09-07 17:54:57 | 2024-09-07 17:54:57 |
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+4);
for(;k>4;k-=4,j=num(j+4))
printf("%d %d %d %d ",j,i,j,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,i,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: 3788kb
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: 3852kb
input:
5166 2
output:
5 2 6 3 7 4 8 5 9 6 10 7 11 8 12 9 13 10 14 11 15 12 16 13 17 14 18 15 19 16 20 17 21 18 22 19 23 20 24 21 25 22 26 23 27 24 28 25 29 26 30 27 31 28 32 29 33 30 34 31 35 32 36 33 37 34 38 35 39 36 40 37 41 38 42 39 43 40 44 41 45 42 46 43 47 44 48 45 49 46 50 47 51 48 52 49 53 50 54 51 55 52 56 53 5...
result:
ok correct
Test #3:
score: 5
Accepted
time: 1ms
memory: 3800kb
input:
7445 2
output:
5 2 6 3 7 4 8 5 9 6 10 7 11 8 12 9 13 10 14 11 15 12 16 13 17 14 18 15 19 16 20 17 21 18 22 19 23 20 24 21 25 22 26 23 27 24 28 25 29 26 30 27 31 28 32 29 33 30 34 31 35 32 36 33 37 34 38 35 39 36 40 37 41 38 42 39 43 40 44 41 45 42 46 43 47 44 48 45 49 46 50 47 51 48 52 49 53 50 54 51 55 52 56 53 5...
result:
ok correct
Test #4:
score: 5
Accepted
time: 0ms
memory: 3832kb
input:
1295 2
output:
5 2 6 3 7 4 8 5 9 6 10 7 11 8 12 9 13 10 14 11 15 12 16 13 17 14 18 15 19 16 20 17 21 18 22 19 23 20 24 21 25 22 26 23 27 24 28 25 29 26 30 27 31 28 32 29 33 30 34 31 35 32 36 33 37 34 38 35 39 36 40 37 41 38 42 39 43 40 44 41 45 42 46 43 47 44 48 45 49 46 50 47 51 48 52 49 53 50 54 51 55 52 56 53 5...
result:
ok correct
Subtask #2:
score: 0
Wrong Answer
Test #5:
score: 0
Wrong Answer
time: 20ms
memory: 3820kb
input:
86132 9
output:
5 1 5 1 9 1 9 1 2 6 2 6 2 10 2 10 2 3 7 3 7 3 11 3 11 3 4 8 4 8 4 12 4 12 4 5 9 5 9 5 13 5 13 5 6 10 6 10 6 14 6 14 6 7 11 7 11 7 15 7 15 7 8 12 8 12 8 16 8 16 8 9 13 9 13 9 17 9 17 9 10 14 10 14 10 18 10 18 10 11 15 11 15 11 19 11 19 11 12 16 12 16 12 20 12 20 12 13 17 13 17 13 21 13 21 13 14 18 14...
result:
wrong answer visit same point several times.
Subtask #3:
score: 0
Skipped
Dependency #2:
0%
Subtask #4:
score: 0
Wrong Answer
Test #16:
score: 0
Wrong Answer
time: 13ms
memory: 3864kb
input:
1777 229
output:
5 1 5 1 9 1 9 1 13 1 13 1 17 1 17 1 21 1 21 1 25 1 25 1 29 1 29 1 33 1 33 1 37 1 37 1 41 1 41 1 45 1 45 1 49 1 49 1 53 1 53 1 57 1 57 1 61 1 61 1 65 1 65 1 69 1 69 1 73 1 73 1 77 1 77 1 81 1 81 1 85 1 85 1 89 1 89 1 93 1 93 1 97 1 97 1 101 1 101 1 105 1 105 1 109 1 109 1 113 1 113 1 117 1 117 1 121 ...
result:
wrong answer visit same point several times.
Subtask #5:
score: 0
Skipped
Dependency #1:
100%
Accepted
Dependency #3:
0%