結果
| 問題 |
No.1472 作為の和
|
| コンテスト | |
| ユーザー |
racsosabe
|
| 提出日時 | 2021-04-09 22:30:20 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 257 bytes |
| コンパイル時間 | 1,489 ms |
| コンパイル使用メモリ | 166,792 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-25 06:07:05 |
| 合計ジャッジ時間 | 2,037 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 10 |
ソースコード
#include<bits/stdc++.h>
using namespace::std;
int n;
int s(long long x){
return x < 10 ? x : x % 10 + s(x / 10);
}
int f(int x){
return x == 0 ? 9 : 3 * (9 + 6 * (x - 1)) - 1;
}
int main(){
scanf("%d", &n);
printf("%d %d\n", f(n), 1);
return 0;
}
racsosabe