結果
問題 |
No.2954 Calculation of Exponentiation
|
ユーザー |
![]() |
提出日時 | 2024-11-08 22:09:24 |
言語 | C (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 289 bytes |
コンパイル時間 | 499 ms |
コンパイル使用メモリ | 30,720 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-08 22:09:36 |
合計ジャッジ時間 | 1,244 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 27 WA * 1 |
ソースコード
#include<stdio.h> #include<math.h> int main() { double a, b; scanf("%lf%lf", &a, &b); if (b > 0) { for (; b > 1; b -= 1); } else { for (; b < -1; b += 1); } double c = pow(a, b); if (floor(c + 1e-14) == ceil(c - 1e-14)) printf("Yes\n"); else printf("No\n"); return 0; }