結果
| 問題 |
No.3012 岩井星人グラフ
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-02-28 11:14:44 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 34 ms / 2,000 ms |
| コード長 | 474 bytes |
| コンパイル時間 | 521 ms |
| コンパイル使用メモリ | 58,204 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2025-02-28 11:14:52 |
| 合計ジャッジ時間 | 7,172 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 23 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:12:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
12 | scanf("%d%d",&x,&y);
| ~~~~~^~~~~~~~~~~~~~
ソースコード
#include<iostream>
#include<cassert>
#define rep(i,n) for(i=0;i<(int)(n);i++)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
int x,y;
int main(){
int i,j,now,tmp;
scanf("%d%d",&x,&y);
printf("%d %d\n",x*y,x*y);
rep(i,x)printf("%d %d\n",i+1,((i+1)%x)+1);
now=x;
rep(i,x){
tmp=i;
rep(j,y-1){
printf("%d %d\n",tmp+1,now+1);
tmp=now;
now++;
}
}
return 0;
}