QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#687340 | #9446. Construction of Town | HTensor# | WA | 0ms | 3672kb | C++23 | 918b | 2024-10-29 18:28:18 | 2024-10-29 18:28:19 |
Judging History
answer
#include <bits/stdc++.h>
#define dd(x) cout << #x << "\n"
#define d(x) cout << #x << ": " << x << "\n"
#define SZ(x) ((int)(x).size())
using namespace std;
#define int long long
using pii = pair<int, int>;
using vpii = vector<pii>;
using vi = vector<int>;
using vii = vector<vector<int>>;
using a3 = array<int, 3>;
using ll = long long;
const int inf = 0x3f3f3f3f3f3f3f3fLL;
// #define MULTI_TEST
void solve() {
int n, m; cin >> n >> m;
for(int i = 1; i < n; i++) {
cout << i << " " << n << "\n";
}
m -= n - 1;
for(int i = 1; i < n; i++) {
for(int j = i + 1; j < n; j++) {
if(m <= 0) break;
cout << i << " " << j << "\n";
}
}
}
signed main() {
ios::sync_with_stdio(false); cin.tie(0);
#ifdef MULTI_TEST
int T; cin >> T;
#else
int T = 1;
#endif
while(T--) solve();
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3660kb
input:
3 2 4 5
output:
1 3 2 3
result:
ok Output is valid. OK
Test #2:
score: 0
Accepted
time: 0ms
memory: 3648kb
input:
4 6 12 34 56
output:
1 4 2 4 3 4 1 2 1 3 2 3
result:
ok Output is valid. OK
Test #3:
score: 0
Accepted
time: 0ms
memory: 3648kb
input:
2 1 998244353
output:
1 2
result:
ok Output is valid. OK
Test #4:
score: 0
Accepted
time: 0ms
memory: 3648kb
input:
3 3 1 10
output:
1 3 2 3 1 2
result:
ok Output is valid. OK
Test #5:
score: -100
Wrong Answer
time: 0ms
memory: 3672kb
input:
5 8 242843383 518993849 724779449 840953559
output:
1 5 2 5 3 5 4 5 1 2 1 3 1 4 2 3 2 4 3 4
result:
wrong answer Participant output contains extra tokens.