QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#551598#7868. 天空度假山庄ASnown5 29ms3904kbC++141.0kb2024-09-07 17:28:022024-09-07 17:28:04

Judging History

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

  • [2024-09-07 17:28:04]
  • 评测
  • 测评结果:5
  • 用时:29ms
  • 内存:3904kb
  • [2024-09-07 17:28:02]
  • 提交

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 SID;
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,j,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,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: 3904kb

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

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

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: 1ms
memory: 3860kb

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: 29ms
memory: 3852kb

input:

86132 9

output:

5 5 7 1 9 9 11 1 2 6 6 8 2 10 10 12 2 3 7 7 9 3 11 11 13 3 4 8 8 10 4 12 12 14 4 5 9 9 11 5 13 13 15 5 6 10 10 12 6 14 14 16 6 7 11 11 13 7 15 15 17 7 8 12 12 14 8 16 16 18 8 9 13 13 15 9 17 17 19 9 10 14 14 16 10 18 18 20 10 11 15 15 17 11 19 19 21 11 12 16 16 18 12 20 20 22 12 13 17 17 19 13 21 21...

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

input:

1777 229

output:

5 5 7 1 9 9 11 1 13 13 15 1 17 17 19 1 21 21 23 1 25 25 27 1 29 29 31 1 33 33 35 1 37 37 39 1 41 41 43 1 45 45 47 1 49 49 51 1 53 53 55 1 57 57 59 1 61 61 63 1 65 65 67 1 69 69 71 1 73 73 75 1 77 77 79 1 81 81 83 1 85 85 87 1 89 89 91 1 93 93 95 1 97 97 99 1 101 101 103 1 105 105 107 1 109 109 111 1...

result:

wrong answer visit same point several times.

Subtask #5:

score: 0
Skipped

Dependency #1:

100%
Accepted

Dependency #3:

0%