結果

問題 No.3012 岩井星人グラフ
ユーザー elphe
提出日時 2025-02-11 13:18:38
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 29 ms / 2,000 ms
コード長 694 bytes
コンパイル時間 1,186 ms
コンパイル使用メモリ 83,500 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2025-02-11 13:18:46
合計ジャッジ時間 7,632 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <cstdint>
#include <vector>

using namespace std;

int main()
{
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	
	uint16_t X, Y;
	cin >> X >> Y;

	const uint32_t size = static_cast<uint32_t>(X) * Y;
	uint16_t i, j;
	cout << size << ' ' << size << '\n';
	cout << "1 " << Y * static_cast<uint32_t>(X - 1) + 1 << '\n';
	for (j = Y - 1; j != 0; --j)
		cout << j << ' ' << j + 1 << '\n';

	for (i = X - 1; i != 0; --i)
	{
		cout << Y * static_cast<uint32_t>(i - 1) + 1 << ' ' << Y * static_cast<uint32_t>(i) + 1 << '\n';
		for (j = Y - 1; j != 0; --j)
			cout << Y * static_cast<uint32_t>(i) + j << ' ' << Y * static_cast<uint32_t>(i) + j + 1 << '\n';
	}

	return 0;
}
0