結果
問題 |
No.722 100×100=1000
|
ユーザー |
|
提出日時 | 2018-08-04 22:51:49 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 2,000 ms |
コード長 | 978 bytes |
コンパイル時間 | 238 ms |
コンパイル使用メモリ | 22,912 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-29 19:27:58 |
合計ジャッジ時間 | 1,249 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 27 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:21:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 21 | scanf("%lld %lld",&A,&B); | ~~~~~^~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h> #define TH 99999999 int tmp[] = { 100 , 200 , 300 , 400 , 500 , 600 , 700 , 800 , 900 , 1000 , 2000 , 3000 , 4000 , 5000 , 6000 , 7000 , 8000 , 9000 , 10000 , 20000 , 30000 , 40000 , 50000 , 60000 , 70000 , 80000 , 90000 , 100000 , 200000 , 300000 , 400000 , 500000 , 600000 , 700000 , 800000 , 900000 , 1000000 , 2000000 , 3000000 , 4000000 , 5000000 , 6000000 , 7000000 , 8000000 , 9000000 , 10000000 , 20000000 , 30000000 , 40000000 , 50000000 , 60000000 , 70000000 , 80000000 , 90000000 , }; char ispow10under8(long a){ for(int i = 0; i < sizeof(tmp)/sizeof(int) ; i++){ if(tmp[i] == a || tmp[i] == -a) return 1; } 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"); } }