結果
| 問題 |
No.2929 Miracle Branch
|
| コンテスト | |
| ユーザー |
Andrew8128
|
| 提出日時 | 2024-10-12 16:51:05 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,108 bytes |
| コンパイル時間 | 2,942 ms |
| コンパイル使用メモリ | 247,336 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-10-12 16:51:16 |
| 合計ジャッジ時間 | 10,557 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 26 WA * 17 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i, x, y) for (auto i = (x); i < (y); i++)
#define RREP(i, x, y) for (auto i = (y) - 1; (x) <= i; i--)
#define ALL(x) (x).begin(), (x).end()
#pragma GCC optimize("O3")
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
ll X;
cin >> X;
if(X == 1){
cout << "2\n1 2\nb g\n";
return 0;
}
vector<int> m;
REP(i, 2, 200000){
while(X % i == 0){
m.push_back(i);
X /= i;
}
}
if(X != 1){
cout << -1 << "\n";
return 0;
}
ll sum = 0;
for(auto v: m){
sum += v;
}
if(200000 < ssize(m) + sum){
cout << -1 << "\n";
return 0;
}
cout << ssize(m) + sum << "\n";
REP(i, 1, ssize(m)){
cout << i << " " << i+1 << "\n";
}
int idx = ssize(m) + 1;
REP(i, 0, ssize(m)){
REP(j, 0, m[i]){
cout << i+1 << " " << idx << "\n";
idx++;
}
}
REP(i, 0, ssize(m)){
cout << "b ";
}
REP(i, 0, sum){
cout << "g ";
}
cout << "\n";
return 0;
}
/*
File : ~/yukicoder/midoriika_3rd/K.cpp
Date : 2024/10/12
Time : 16:02:23
*/
Andrew8128