結果
| 問題 |
No.1149 色塗りゲーム
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-08-07 22:13:37 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 703 bytes |
| コンパイル時間 | 1,010 ms |
| コンパイル使用メモリ | 99,312 KB |
| 最終ジャッジ日時 | 2025-01-12 17:03:28 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 2 TLE * 48 |
ソースコード
#include <algorithm>
#include <chrono>
#include <cmath>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <numeric>
#include <vector>
using namespace std;
int main() {
int n, t, k, x;
cin >> n;
if (n == 1) {
cout << "1 1" << endl;
cin >> t;
return 0;
}
if (n == 2) {
cout << "2 1" << endl;
cin >> t;
return 0;
}
if (n & 1) {
cout << n / 2 + 1 << " 1" << endl;
} else {
cout << n / 2 << " 2" << endl;
}
while (true) {
cin >> t;
if (t == 0) break;
cin >> k >> x;
if (k > n / 2) {
cout << k - (n / 2 + 1) << " " << k << endl;
} else {
cout << k + (n / 2 + 1) << " " << k << endl;
}
}
return 0;
}