結果

問題 No.3062 A + B
ユーザー CleyLCleyL
提出日時 2020-04-01 21:55:32
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,709 bytes
コンパイル時間 1,041 ms
コンパイル使用メモリ 93,556 KB
実行使用メモリ 4,388 KB
最終ジャッジ日時 2023-09-09 18:06:01
合計ジャッジ時間 2,077 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 1 ms
4,384 KB
testcase_04 AC 2 ms
4,384 KB
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 AC 2 ms
4,384 KB
testcase_09 AC 1 ms
4,384 KB
testcase_10 AC 2 ms
4,384 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

//author:luckYrat(twitter:@luckYrat_)

#include <iostream>

#include <cmath>
#include <algorithm>
#include <iomanip>

#include <string>
#include <vector>
#include <set>
#include <stack>
#include <queue>
#include <map>
#include <bitset>

#include <cctype>
#include <utility>
#include <climits>


using namespace std;
using ll = long long;
using P = pair<ll,ll>;


const int mod = 1000000007;
const int inf = (1<<30)-1;
const ll linf = (1LL<<62LL)-1;
const double EPS = (1e-10);


#define anyfill(n,s) setw(n) << setfill(s)
#define loop(s) for(int i = 0; s > i; i++)
#define rep(i,q) for(int i = 0; (q) > i; i++)
#define repp(i,n,q) for(int i = n; (q) > i; i++)
#define dep(i,q) for(int i = (q); 0 < i; i--)


#define pb push_back
#define fir first
#define scn second
#define ednl endl


#define YesNo(a) (a?"Yes":"No")
#define YESNO(a) (a?"YES":"NO")
#define yesno(a) (a?"yes":"no")

P ar4[4] = {{0,1},{0,-1},{1,0},{-1,0}};
P ar8[8] = {{-1,-1},{-1,0},{-1,1},{0,-1},{0,1},{1,-1},{1,0},{1,1}};


__attribute__((constructor))
void initial() {
 cin.tie(0);
 ios::sync_with_stdio(false);
}
int main(){
  string a,b;cin>>a>>b;
  bool z = false;
  string A = "";
  string B = "";
  for(int i = 0; a.size() > i; i++){
    if(a[i]=='+' || a[i]=='-'){
      if(a[i]=='-'){
        if(z)z=false;
        else z = true;
      }
    }else{
      A = a.substr(i,a.size()-i+1);
      break;
    }
  }
  int y = false;
  for(int i = 0; b.size() > i; i++){
    if(b[i]=='+' || b[i]=='-'){
      if(b[i]=='-'){
        if(y)y=false;
        else y = true;
      }
    }else{
      B = b.substr(i,b.size()-i+1);
      break;
    }
  }
  cout << stoi(a)+stoi(b) << endl;
  //cout << stoi(A)*(z?-1:1) + stoi(B)*(y?-1:1) << endl;
}
0