Submission #00100
ソースコード
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | #include <bits/stdc++.h> #define endl "\n" using namespace std; int main(){ long long x = 1, y = 0; int a, n, m, ans = 0; cin >> a >> n >> m; // 最低の2乗をとると10^4が上限 for ( int i = 1; i < 10001; i++){ x = 1; // n乗の回数 for ( int j = 0; j < n; j++){ x *= i; } // 上限オーバー if (m < x){ break ; } // ()の中身を求める y = 0; while (x){ y += x % 10; x /= 10; } // 判定 if (y + a == i){ ans++; } } cout << ans << endl; return (0); } |
ステータス
項目 | データ |
---|---|
問題 | 0005 - デュードニー数 |
ユーザー名 | ei2212 |
投稿日時 | 2023-07-24 10:14:19 |
言語 | C++17 |
状態 | Accepted |
得点 | 6 |
ソースコード長 | 695 Byte |
最大実行時間 | 27 ms |
最大メモリ使用量 | 636 KB |
セット
セット | 得点 | Cases | |
---|---|---|---|
1 | ALL | 6 / 6 | * |
テストケース
ファイル名 | 状態 | 実行時間 | メモリ使用量 | # |
---|---|---|---|---|
in1.txt | AC | 15 ms | 604 KB |
1
|
in2.txt | AC | 24 ms | 528 KB |
1
|
in3.txt | AC | 27 ms | 496 KB |
1
|
in4.txt | AC | 18 ms | 472 KB |
1
|
in5.txt | AC | 15 ms | 564 KB |
1
|
in6.txt | AC | 21 ms | 536 KB |
1
|
in7.txt | AC | 20 ms | 636 KB |
1
|
in8.txt | AC | 20 ms | 604 KB |
1
|
in9.txt | AC | 19 ms | 580 KB |
1
|
in10.txt | AC | 19 ms | 452 KB |
1
|
in11.txt | AC | 19 ms | 420 KB |
1
|
in12.txt | AC | 20 ms | 516 KB |
1
|
in13.txt | AC | 25 ms | 356 KB |
1
|
in14.txt | AC | 21 ms | 456 KB |
1
|
in15.txt | AC | 25 ms | 556 KB |
1
|