結果
| 問題 |
No.3081 Make Palindromic Multiple
|
| コンテスト | |
| ユーザー |
沙耶花
|
| 提出日時 | 2025-03-28 23:55:51 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 703 bytes |
| コンパイル時間 | 4,357 ms |
| コンパイル使用メモリ | 252,784 KB |
| 実行使用メモリ | 7,328 KB |
| 最終ジャッジ日時 | 2025-03-28 23:56:08 |
| 合計ジャッジ時間 | 16,949 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 9 RE * 45 |
ソースコード
#include <stdio.h>
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace atcoder;
using mint = modint998244353;
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define Inf32 1000000000
#define Inf64 1000000000000000001LL
int main(){
long long n;
cin>>n;
long long t = n;
long long phi = n;
for(long long i=2;i*i<=t;i++){
if(t%i==0){
phi /= i;
phi *= i-1;
while(t%i==0)t/=i;
}
}
if(t>=2){
phi /= t;
phi *= t-1;
}
n *= 3;
string s = to_string(n);
s = string(s.rbegin(),s.rend()) + s;
cout<<2<<endl;
cout<<s<<' '<<1<<endl;
while(phi <= s.size()){
phi *= 2;
}
s = string(phi - s.size(),'0') + s;
cout<<s<<' '<<n-1<<endl;
return 0;
}
沙耶花