QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#643214 | #7619. Make SYSU Great Again I | Fluoresce# | WA | 0ms | 3872kb | C++20 | 1.8kb | 2024-10-15 19:52:48 | 2024-10-15 19:52:48 |
Judging History
answer
#include<bits/stdc++.h>
#include<unordered_map>
#include<unordered_set>
typedef long long ll;
typedef long double ld;
#define debug(a) cout<<a<<'\n'
#define Pll pair<ll,ll>
#define PII pair<int,int>
#define ft first
#define sd second
#define vec vector
#define pushk push_back
#define pl p<<1
#define pr p<<1|1
using namespace std;
const int N = 2e5 + 10, M = 1e4 + 10, mod = 1e9 + 7;
const ll inf = 1e18;
const ld eps = 1e-13;
int mov[4][2] = { {0,1},{1,0},{-1,0},{0,-1} }, dx, dy, _ = 1, __ = 1;
void bout(bool f) {
if (f)cout << "Yes\n";
else cout << "No\n";
}
ll n, m, k;
void ini() {
}
void solve() {
int cnt,x,y;
cin>>n>>k;
unordered_set<ll>st;
cnt=0;
if(n&1){
cout<<1<<' '<<1<<'\n';
cout<<1<<' '<<2<<'\n';
cout<<2<<' '<<2<<'\n';
cout<<2<<' '<<3<<'\n';
st.insert(1*N+1);
st.insert(1*N+2);
st.insert(2*N+2);
st.insert(2*N+3);
cnt=4;
}
for(int i=(n&1)?4:1;i<n;i+=2){
cout<<i<<' '<<i<<'\n';
cout<<i<<' '<<i+1<<'\n';
cout<<i+1<<' '<<i+1<<'\n';
cout<<i+1<<' '<<i<<'\n';
st.insert(i*N+i);
st.insert(i*N+i+1);
st.insert((i+1)*N+i+1);
st.insert((i+1)*N+i);
cnt+=4;
}
if(n&1){
cout<<"3 3\n3 1\n";
st.insert(3*N+3);
st.insert(3*N+1);
cnt+=2;
}
if(cnt==k)return;
for(int i=1;i<=n;++i){
for(int j=1;j<=n;++j){
if(!st.count(i*N+j)){
cout<<i<<' '<<j<<'\n';
if(++cnt==k)return;
}
}
}
}
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
#ifndef ONLINE_JUDGE
streambuf* cinbackup = cin.rdbuf(), * coutbackup = cout.rdbuf();
ifstream fin("in.txt");
ofstream fout("out.txt");
cin.rdbuf(fin.rdbuf());
cout.rdbuf(fout.rdbuf());
#endif
//cin >> _;
__ = _;
ini();
while (_--) {
solve();
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3624kb
input:
3 6
output:
1 1 1 2 2 2 2 3 3 3 3 1
result:
ok The answer is correct.
Test #2:
score: 0
Accepted
time: 0ms
memory: 3872kb
input:
3 7
output:
1 1 1 2 2 2 2 3 3 3 3 1 1 3
result:
ok The answer is correct.
Test #3:
score: 0
Accepted
time: 0ms
memory: 3852kb
input:
2 4
output:
1 1 1 2 2 2 2 1
result:
ok The answer is correct.
Test #4:
score: 0
Accepted
time: 0ms
memory: 3508kb
input:
3 9
output:
1 1 1 2 2 2 2 3 3 3 3 1 1 3 2 1 3 2
result:
ok The answer is correct.
Test #5:
score: -100
Wrong Answer
time: 0ms
memory: 3556kb
input:
10 20
output:
1 1 1 2 2 2 2 1 3 3 3 4 4 4 4 3 5 5 5 6 6 6 6 5 7 7 7 8 8 8 8 7 9 9 9 10 10 10 10 9
result:
wrong answer The answer is wrong: The maximum common divisor of row 5 and column 1677649024 is not the same.