結果
| 問題 | No.222 引き算と足し算 |
| コンテスト | |
| ユーザー |
yaoshimax
|
| 提出日時 | 2015-06-06 15:06:27 |
| 言語 | PyPy2 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 386 bytes |
| 記録 | |
| コンパイル時間 | 174 ms |
| コンパイル使用メモリ | 77,308 KB |
| 最終ジャッジ日時 | 2025-12-03 15:32:04 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 26 WA * 5 |
ソースコード
S=raw_input()
s=1
x=0
ind=0
if(S[0]=='-'):
s=-1
ind+=1
if(S[0]=='+'):
ind+=1
while S[ind]!='-' and S[ind]!='+':
x*=10
x+=ord(S[ind])-ord('0')
ind+=1
x*=s
if(S[ind]=='-'):
s=+1
ind+=1
if(S[ind]=='+'):
s=-1
ind+=1
if(S[ind]=='-'):
s*=-1
ind+=1
if(S[ind]=='+'):
ind+=1
y=0
for c in S[ind::]:
y*=10
y+=ord(c)-ord('0')
print x+s*y
yaoshimax