結果
| 問題 |
No.3341 Making Beautiful Graphs
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-11-13 23:53:52 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,452 bytes |
| コンパイル時間 | 3,442 ms |
| コンパイル使用メモリ | 275,320 KB |
| 実行使用メモリ | 7,716 KB |
| 最終ジャッジ日時 | 2025-11-13 23:53:59 |
| 合計ジャッジ時間 | 6,631 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 49 WA * 1 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
#define all(a) a.begin(), a.end()
#define sz(a) ((int)a.size())
#define pb push_back
#ifdef Doludu
template <typename T>
ostream& operator << (ostream &o, vector<T> vec) {
o << "{"; int f = 0;
for (T i : vec) o << (f++ ? " " : "") << i;
return o << "}";
}
void bug__(int c, auto ...a) {
cerr << "\e[1;" << c << "m";
(..., (cerr << a << " "));
cerr << "\e[0m" << endl;
}
#define bug_(c, x...) bug__(c, __LINE__, "[" + string(#x) + "]", x)
#define bug(x...) bug_(32, x)
#define bugv(x...) bug_(36, vector(x))
#define safe bug_(33, "safe")
#else
#define bug(x...) void(0)
#define bugv(x...) void(0)
#define safe void(0)
#endif
const int mod = 998244353, N = 200087;
int add(int a, int b) { a += b; if (a >= mod) a -= mod; return a; }
int sub(int a, int b) { a -= b; if (a < 0) a += mod; return a; }
int mul(int a, int b) { return 1ll * a * b % mod; }
int Pow(int a, int b) { int ans = 1; for (; b; b >>= 1, a = mul(a, a)) if (b & 1) ans = mul(ans, a); return ans; }
int main() {
ios::sync_with_stdio(false), cin.tie(0);
int n;
cin >> n;
if (n == 2) {
cout << "-1\n";
} else {
cout << n * n * 2 << "\n";
for (int i = 0; i < n * n; ++i) {
cout << i + 1 << " " << (i + n) % (n * n) + 1 << "\n";
cout << i + 1 << " " << (i + 1) % (n * n) + 1 << "\n";
}
}
}