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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
#include <iostream>
#include <vector>
using namespace std;
 
class Bigint {
public :
    typedef unsigned int ui;
    typedef unsigned long long ull;
private :
    vector<ui> content;
    int degree;
public :
    Bigint() { }
 
    Bigint(ui _content) : degree(0)
    { 
        content.push_back(_content);
    }
 
    void expand(ui target)
    {
        degree++;
        content.push_back(target);
    }
 
    Bigint& operator= (const Bigint& target)
    {
        content.clear();
        int degree = target.degree;
        for (int i = 0; i <= degree; i++)
        {
            content.push_back(target.content[i]);
        }
        return *this;
    }
 
    Bigint operator* (const int target)
    {    
        Bigint save(*this);
        ull s =0;
        ull trans;
        for (int i = 0; i <= degree; i++)
        {
            trans = (ull)content[i];
            trans = trans * target;
            trans = trans + s;
            s = trans >> 16;
            trans = trans & 0x0000FFFF;
            content[i] = (int)trans;
        }
        if (s)
        {
            save.expand(s);
        }
        return save;
    }
 
    Bigint operator+ (const Bigint& target)
    {
        Bigint save(*this);
        ull s = 0;
        ull trans;
        for (int i = 0; i <= degree; i++)
        {
            trans = (ull)content[i];
            trans = trans + s;
            if (i <= target.degree)
            {
                trans = trans + (ull)target.content[i];
            }
            s = trans >> 16;
            trans = trans & 0x0000FFFF;
            content[i] = (int)trans;
        }
        if (degree < target.degree)
        {
            for (int i = degree + 1; i <= target.degree; i++)
            {
                save.expand(target.content[i]);
                trans = (ull)content[i];
                trans = trans + s;
                s = trans >> 16;
                trans = trans & 0x0000FFFF;
                content[i] = (int)trans;
            }
        }
        if (s)
        {
            save.expand(s);
        }
        return save;
    }
 
    bool operator< (const Bigint& target)
    {
        if (degree < target.degree)
        {
            return true;
        }
        else if (degree == target.degree)
        {
            if (content[degree] < target.content[target.degree])
            {
                return true;
            }
            else
            {
                return false;
            }
        }
        else
        {
            return false;
        }
    }
 
    void show()
    {
        for (int i = degree; i >= 0; i--)
        {
            cout << content[i];
        }
        cout << endl;
    }
 
    ~Bigint() 
    { 
        content.clear();
        cout << "disable" << endl;
    }
};
 
int main()
{
    Bigint *solid[4];//0:a, 1:b, 2:전에먹은량, 3:지금 먹은량
    int a, b, c;
 
    cin >> a >>b;
    solid[0= new Bigint(a);
    solid[1= new Bigint(b);
    solid[2= new Bigint(0);
    cin >> a >> b >> c;
    solid[0]->show();
 
    *solid[0= *solid[0* a;
    *solid[1= *solid[1* b;
 
    solid[0]->show();
 
    delete solid[0];
    delete solid[1];
    delete solid[2];
 
    return 0;
}
cs

뻑은 안나는데 원하는 계산은 되지 않네요 5 500 이 나와야되는데 5 5 가 나오네요