結果
| 問題 |
No.441 和か積
|
| コンテスト | |
| ユーザー |
kyuridenamida
|
| 提出日時 | 2016-11-11 22:22:07 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 406 bytes |
| コンパイル時間 | 1,334 ms |
| コンパイル使用メモリ | 158,936 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-06-27 03:06:29 |
| 合計ジャッジ時間 | 2,179 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 30 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
long long f(string s){
long long x = 0;
for(int i = 0 ; i < s.size() ; i++){
x = x * 10 + s[i] - '0';
if( x >= 10 ) return x;
}
return x;
}
int main(){
string A,B;
cin >> A >> B;
long long a = f(A);
long long b = f(B);
if( a + b < a*b ){
cout << "P" << endl;
}else if( a + b > a*b ){
cout << "S" << endl;
}else{
cout << "E" << endl;
}
}
kyuridenamida