結果

問題 No.3062 A + B
ユーザー mmn15277198mmn15277198
提出日時 2020-11-13 13:47:12
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 846 bytes
コンパイル時間 709 ms
コンパイル使用メモリ 91,672 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-09-30 02:04:33
合計ジャッジ時間 1,451 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include<iostream>
#include<stdio.h>
#include<stdlib.h>
#include<algorithm>
#include<vector>
#include<string.h>
#include<math.h>
#include<map>
#include<iomanip>
#include<queue>

using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;

ll mod = 1e9 + 7;

int f(string s){
    int res = 0;
    bool minus = false;
    for(int i = 0; i < s.size(); i++){
        if('0' <= s[i] && s[i] <= '9'){
            res += s[i] - '0';
            res *= 10;
        }else if(s[i] == '-'){
            minus = true;
        }
    }
    res /= 10;
    if(minus){
        res *= -1;
    }
    return res;
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    //cout << fixed << setprecision(15);
    string a , b;
    cin >> a >> b;
    int ans = f(a) + f(b);
    cout << ans << endl;
    return 0;
}
 
 
0