結果
| 問題 |
No.3012 岩井星人グラフ
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-02-22 01:47:40 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 347 ms / 2,000 ms |
| コード長 | 550 bytes |
| コンパイル時間 | 3,647 ms |
| コンパイル使用メモリ | 278,072 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2025-02-22 01:47:52 |
| 合計ジャッジ時間 | 11,038 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 23 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define all(a) begin(a) end(a)
#define rep(i,a,b) for(ll i = a; i < (b); i++)
int main(){
int x,y;
cin >> x >> y;
vector<pair<int,int>> ans;
rep(i,0,x){
ans.push_back({i + 1, (i+1) % x + 1});
}
rep(i,0,x){
rep(j,0,y-1){
ans.push_back({(j * x + i) + 1, ((j+1) * x + i) + 1});
}
}
cout << x*y << " " << ans.size()<< endl;
rep(i,0,ans.size()){
cout << ans[i].first << " " << ans[i].second << endl;
}
}