結果
問題 | No.1218 Something Like a Theorem |
ユーザー | kk |
提出日時 | 2021-01-29 09:46:09 |
言語 | C (gcc 12.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 879 bytes |
コンパイル時間 | 411 ms |
コンパイル使用メモリ | 28,892 KB |
実行使用メモリ | 4,380 KB |
最終ジャッジ日時 | 2023-09-09 04:38:24 |
合計ジャッジ時間 | 1,515 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge12 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 0 ms
4,380 KB |
testcase_01 | AC | 0 ms
4,376 KB |
testcase_02 | AC | 5 ms
4,380 KB |
testcase_03 | AC | 0 ms
4,376 KB |
testcase_04 | AC | 1 ms
4,380 KB |
testcase_05 | AC | 2 ms
4,376 KB |
testcase_06 | AC | 1 ms
4,380 KB |
testcase_07 | AC | 2 ms
4,376 KB |
testcase_08 | AC | 2 ms
4,376 KB |
testcase_09 | AC | 3 ms
4,376 KB |
testcase_10 | AC | 1 ms
4,376 KB |
testcase_11 | AC | 1 ms
4,380 KB |
testcase_12 | AC | 1 ms
4,376 KB |
testcase_13 | AC | 0 ms
4,376 KB |
testcase_14 | AC | 1 ms
4,380 KB |
testcase_15 | AC | 1 ms
4,380 KB |
testcase_16 | AC | 1 ms
4,376 KB |
testcase_17 | WA | - |
コンパイルメッセージ
main.c: 関数 ‘main’ 内: main.c:32:17: 警告: 非 void を戻す関数内に値が無い ‘return’ があります 32 | return; | ^~~~~~ main.c:17:5: 備考: ここで宣言されています 17 | int main(int argc, char* argv[]) | ^~~~
ソースコード
#include <stdio.h> #include <string.h> #define u_int64 unsigned long long u_int64 ori_pow(u_int64 base, u_int64 num) { u_int64 ans = 1; u_int64 i = num; while (num != 0) { ans = ans * base; num--; } return ans; } int main(int argc, char* argv[]) { u_int64 n = 0; u_int64 z = 0; u_int64 ans = 0; u_int64 maxSize = 0; scanf("%lld%lld", &n, &z); ans = ori_pow(z, n); maxSize = ori_pow(10, 6); if (n < 0 || 100 < n || z < 0 || maxSize < ans) { printf("No"); return; } int x = 1; int y = 1; u_int64 check = 0; char isOK = 0; // yes = 1, no = 0 while (!isOK) { y = 1; check = 0; if (maxSize < ori_pow(x, n)) { break; } while (check < ans) { check = ori_pow(x, n) + ori_pow(y, n); if (check == ans) { isOK = 1; break; } y++; } x++; } if (isOK) { printf("Yes"); } else { printf("No"); } return 0; }