QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#264973 | #7868. 天空度假山庄 | zyz07 | 5 | 36ms | 3816kb | C++17 | 693b | 2023-11-25 16:14:40 | 2023-11-25 16:14:41 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define For(Ti,Ta,Tb) for(auto Ti=(Ta);Ti<=(Tb);++Ti)
#define Dec(Ti,Ta,Tb) for(auto Ti=(Ta);Ti>=(Tb);--Ti)
#define debug(...) fprintf(stderr,__VA_ARGS__)
#define range(Tx) begin(Tx),end(Tx)
using ll=long long;
int n,k;
int main(){
cin.tie(nullptr)->sync_with_stdio(false);
cin>>n>>k;
vector<int> vec;
int sum=0;
for(int i=1,x=n-1;i<k-1;i+=2){
vec.push_back(-(x--));
vec.push_back(x--);
--sum;
}
if(k%2){
vec.push_back(1-sum);
}else{
vec.push_back(-1);
vec.push_back(2-sum);
}
For(i,1,n-1){
int u=i;
For(j,1,k){
u=(u+vec[j-1]+n-1)%n+1;
cout<<u<<' ';
}
}
cout<<'\n';
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 5
Accepted
Test #1:
score: 5
Accepted
time: 1ms
memory: 3600kb
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: 0
Accepted
time: 1ms
memory: 3816kb
input:
5166 2
output:
5166 2 1 3 2 4 3 5 4 6 5 7 6 8 7 9 8 10 9 11 10 12 11 13 12 14 13 15 14 16 15 17 16 18 17 19 18 20 19 21 20 22 21 23 22 24 23 25 24 26 25 27 26 28 27 29 28 30 29 31 30 32 31 33 32 34 33 35 34 36 35 37 36 38 37 39 38 40 39 41 40 42 41 43 42 44 43 45 44 46 45 47 46 48 47 49 48 50 49 51 50 52 51 53 52 ...
result:
ok correct
Test #3:
score: 0
Accepted
time: 1ms
memory: 3612kb
input:
7445 2
output:
7445 2 1 3 2 4 3 5 4 6 5 7 6 8 7 9 8 10 9 11 10 12 11 13 12 14 13 15 14 16 15 17 16 18 17 19 18 20 19 21 20 22 21 23 22 24 23 25 24 26 25 27 26 28 27 29 28 30 29 31 30 32 31 33 32 34 33 35 34 36 35 37 36 38 37 39 38 40 39 41 40 42 41 43 42 44 43 45 44 46 45 47 46 48 47 49 48 50 49 51 50 52 51 53 52 ...
result:
ok correct
Test #4:
score: 0
Accepted
time: 1ms
memory: 3596kb
input:
1295 2
output:
1295 2 1 3 2 4 3 5 4 6 5 7 6 8 7 9 8 10 9 11 10 12 11 13 12 14 13 15 14 16 15 17 16 18 17 19 18 20 19 21 20 22 21 23 22 24 23 25 24 26 25 27 26 28 27 29 28 30 29 31 30 32 31 33 32 34 33 35 34 36 35 37 36 38 37 39 38 40 39 41 40 42 41 43 42 44 43 45 44 46 45 47 46 48 47 49 48 50 49 51 50 52 51 53 52 ...
result:
ok correct
Subtask #2:
score: 0
Wrong Answer
Test #5:
score: 0
Wrong Answer
time: 36ms
memory: 3524kb
input:
86132 9
output:
2 86132 3 86131 4 86130 5 86129 2 3 1 4 86132 5 86131 6 86130 3 4 2 5 1 6 86132 7 86131 4 5 3 6 2 7 1 8 86132 5 6 4 7 3 8 2 9 1 6 7 5 8 4 9 3 10 2 7 8 6 9 5 10 4 11 3 8 9 7 10 6 11 5 12 4 9 10 8 11 7 12 6 13 5 10 11 9 12 8 13 7 14 6 11 12 10 13 9 14 8 15 7 12 13 11 14 10 15 9 16 8 13 14 12 15 11 16 ...
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: 17ms
memory: 3592kb
input:
1777 229
output:
2 1777 3 1776 4 1775 5 1774 6 1773 7 1772 8 1771 9 1770 10 1769 11 1768 12 1767 13 1766 14 1765 15 1764 16 1763 17 1762 18 1761 19 1760 20 1759 21 1758 22 1757 23 1756 24 1755 25 1754 26 1753 27 1752 28 1751 29 1750 30 1749 31 1748 32 1747 33 1746 34 1745 35 1744 36 1743 37 1742 38 1741 39 1740 40 1...
result:
wrong answer visit same point several times.
Subtask #5:
score: 0
Skipped
Dependency #1:
100%
Accepted
Dependency #3:
0%