結果
| 問題 |
No.1880 Many Ways
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-03-17 16:55:09 |
| 言語 | C++17(clang) (17.0.6 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 637 bytes |
| コンパイル時間 | 1,324 ms |
| コンパイル使用メモリ | 130,852 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-01 13:38:58 |
| 合計ジャッジ時間 | 12,358 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 2 WA * 12 |
ソースコード
#include <functional>
#include <iostream>
#include <optional>
#include <vector>
#include <atcoder/modint>
using namespace std;
int main()
{
long long A;
cin >> A;
vector<pair<int, int>> V;
if (A == 0)
{
cout << 2 << " " << 0 << endl;
return 0;
}
else if (A == 1)
{
cout << 1 << " " << 0 << endl;
return 0;
}
int u = 1, d = 1;
while (A != 1)
{
int nu = u + 2, nd = u + 1;
V.emplace_back(u, nu);
V.emplace_back(u, nu);
V.emplace_back(d, nd);
if (A & 1)
V.emplace_back(d, nu);
A >>= 1;
u = nu, d = nd;
}
cout << u << " " << V.size() << endl;
for (auto [a, b] : V)
cout << a << " " << b << endl;
}