結果
問題 | No.3012 岩井星人グラフ |
ユーザー |
![]() |
提出日時 | 2025-01-25 12:50:54 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 38 ms / 2,000 ms |
コード長 | 1,017 bytes |
コンパイル時間 | 6,317 ms |
コンパイル使用メモリ | 331,772 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2025-01-25 22:23:45 |
合計ジャッジ時間 | 10,763 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 23 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:33:23: warning: ‘pre’ may be used uninitialized [-Wmaybe-uninitialized] 33 | cout << pre + 1 << ' ' << i + x + 1 << '\n'; | ^ main.cpp:30:7: note: ‘pre’ was declared here 30 | int pre; | ^~~
ソースコード
#include <bits/stdc++.h> #include <atcoder/all> using namespace std; using namespace atcoder; #define all(x) (x).begin(), (x).end() #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rrep(i, n) for(int i = (int)(n - 1); i >= 0; i--) template <typename T> bool chmax(T &a,const T &b){if(a<b){a=b;return true;}return false;} template <typename T> bool chmin(T &a,const T &b){if(a>b){a=b;return true;}return false;} using ll = long long; #define int ll using vi = vector<int>; using vvi = vector<vector<int>>; using vb = vector<bool>; using vvb = vector<vector<bool>>; using vs = vector<string>; using pii = pair<int, int>; /* using mint = modint; using vm = vector<mint>; using vvm = vector<vector<mint>>; */ signed main(){ int x, y; cin >> x >> y; cout << x * y << ' ' << x * y << '\n'; rep(i, x){ cout << i + 1 << ' ' << (i + 1) % x + 1 << '\n'; } int pre; rep(i, x * (y - 1)){ if(i % (y - 1) == 0) pre = i / (y - 1); cout << pre + 1 << ' ' << i + x + 1 << '\n'; pre = i + x; } }