結果
問題 |
No.722 100×100=1000
|
ユーザー |
|
提出日時 | 2018-08-04 22:55:42 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 2,000 ms |
コード長 | 585 bytes |
コンパイル時間 | 181 ms |
コンパイル使用メモリ | 22,912 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-29 19:27:44 |
合計ジャッジ時間 | 1,018 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 27 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:16:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 16 | scanf("%lld %lld",&A,&B); | ~~~~~^~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h> #define TH 99999999 char ispow10under8(long k){ int a = 100; while(a <= 100000000){ for(int n = 1; n <= 9; n++){ if( n*a == k || -n*a == k) return 1; } a *= 10; } return 0; } int main(){ long long A,B; scanf("%lld %lld",&A,&B); if(ispow10under8(A) && ispow10under8(B)){ printf("%lld\n",(A*B)/10); }else{ if(-TH <= A*B && A*B <= TH) printf("%lld\n",A*B); else puts("E"); } }