hihoCoder太阁最新面经算法竞赛14 register

Ended

Participants:84

Verdict:Accepted
Score:100 / 100
Submitted:2016-11-12 10:31:23

Lang:G++

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/*
ID: y1197771
PROG: test
LANG: C++
*/
#include<bits/stdc++.h>
#define pb push_back
#define FOR(i, n) for (int i = 0; i < (int)n; ++i)
#define dbg(x) cout << #x << " at line " << __LINE__ << " is: " << x << endl
typedef long long ll;
using namespace std;
typedef pair<int, int> pii;
const int maxn = 1e3 + 10;
string add(string s1, string s2) {
    int n = s1.size(), m = s2.size();
    int i, j, c; c = i = j = 0;
    string res = "";
    while(i < n && j < m) {
        int d = s1[i] + s2[j] - '0' * 2 + c;
        c = d / 10;
        d = d % 10;
        res += char('0' + d);
        i++; j++;
    }
    while(i < n) {
        int d = s1[i] - '0' + c;
        c = d / 10; d = d % 10;
        res += char('0' + d);
        i++;
    }
    while(j < m) {
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX