結果

問題 No.3012 岩井星人グラフ
ユーザー VvyLw
提出日時 2025-02-08 14:45:40
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 33 ms / 2,000 ms
コード長 814 bytes
コンパイル時間 1,034 ms
コンパイル使用メモリ 109,000 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2025-02-08 14:45:47
合計ジャッジ時間 6,435 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#ifdef local
#include <C++/core/io/debug_print.hpp>
#else
#define dump(...) void(0);
#endif

#include <iostream>
#include <ranges>
#include <cassert>
namespace man {

}
int main() {
    std::cin.tie(nullptr) -> sync_with_stdio(false);
    using namespace std::views;
    int x, y;
    std::cin >> x >> y;
    const auto z = x * y;
    std::cout << z << ' ' << z << '\n';
    for(const auto i: iota(0, x)) {
    	for(const auto j: iota(1) | take(y - 1)) {
    		std::cout << y * i + j << ' ' << y * i + j + 1 << '\n';
    	}
    	if(i + 1 < x) {
    		std::cout << i * y + 1 << ' ' << (i + 1) * y + 1 << '\n';
    	}
    }
    std::cout << "1 " << z - y + 1 << '\n';
}
0