結果
問題 |
No.722 100×100=1000
|
ユーザー |
![]() |
提出日時 | 2018-08-03 23:33:17 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 656 bytes |
コンパイル時間 | 1,374 ms |
コンパイル使用メモリ | 160,980 KB |
実行使用メモリ | 13,632 KB |
最終ジャッジ日時 | 2024-10-12 10:45:10 |
合計ジャッジ時間 | 5,712 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 16 WA * 3 OLE * 1 -- * 7 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main(){ long long a,b; cin >>a>>b; if(a==0&&b==0){cout << 0 << endl;return 0;} string sa,sb; sa=to_string(abs(a)); sb=to_string(abs(b)); bool cal=true; for(int i=1;i<sa.size();++i){ if(sa[i]!='0')cal=false; } for(int i=1;i<sb.size();++i){ if(sb[i]!='0')cal=false; } if(cal){ if(a*b<0)cout << "-"; cout << (sa[0]-'0')*(sb[0]-'0'); for(int i=0;i<(sa.size()+sb.size()-3);++i){ cout << "0"; } cout << endl; return 0; } if(a*b>99999999||a*b<-99999999){ cout << "E" << endl; return 0; }else{ cout << a*b << endl; } return 0; }