QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#741579 | #7619. Make SYSU Great Again I | Carucao# | WA | 0ms | 3624kb | C++20 | 905b | 2024-11-13 14:40:52 | 2024-11-13 14:40:52 |
Judging History
answer
#include<bits/stdc++.h>
#define endl '\n'
#define int long long
using namespace std;
const int N=1e6+10;
pair<int,int> ans[N];
int n,m,k;
void work()
{
cin>>n>>k;
int l=1,r=2*n,o=1;
for(int i=1;i<=n;++i)
{
int j=i+1;
if(j==n+1) j=1;
if(o)
{
ans[l]=make_pair(i,i);
ans[r]=make_pair(i,j);
}
else
{
ans[r]=make_pair(i,i);
ans[l]=make_pair(i,j);
}
++l;
--r;
o^=1;
}
int x=2*n+1;
for(int i=1;i<=n;++i)
{
int u=i,v=i+1;
if(v==n+1) v=1;
for(int j=1;j<=n;++j)
{
if(j==u||j==v) continue;
ans[x]=make_pair(i,j);
++x;
if(x>k) break;
}
}
for(int i=1;i<=k;++i) cout<<ans[i].first<<" "<<ans[i].second<<endl;
}
signed main()
{
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int T=1;
//cin>>T;
for(;T;--T)
work();
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3624kb
input:
3 6
output:
1 1 2 3 3 3 3 1 2 2 1 2
result:
ok The answer is correct.
Test #2:
score: 0
Accepted
time: 0ms
memory: 3616kb
input:
3 7
output:
1 1 2 3 3 3 3 1 2 2 1 2 1 3
result:
ok The answer is correct.
Test #3:
score: 0
Accepted
time: 0ms
memory: 3576kb
input:
2 4
output:
1 1 2 1 2 2 1 2
result:
ok The answer is correct.
Test #4:
score: 0
Accepted
time: 0ms
memory: 3548kb
input:
3 9
output:
1 1 2 3 3 3 3 1 2 2 1 2 1 3 2 1 3 2
result:
ok The answer is correct.
Test #5:
score: -100
Wrong Answer
time: 0ms
memory: 3576kb
input:
10 20
output:
1 1 2 3 3 3 4 5 5 5 6 7 7 7 8 9 9 9 10 1 10 10 9 10 8 8 7 8 6 6 5 6 4 4 3 4 2 2 1 2
result:
wrong answer The answer is wrong: The maximum common divisor of row 3 and column -984488832 is not the same.