File tree 2 files changed +16
-1
lines changed
2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change
1
+ input_numbers = input ().split (" " )
2
+ a ,b = int (input_numbers [0 ]), int (input_numbers [1 ])
3
+ def getSum (a : int , b : int ) -> int :
4
+ mask = 0xffffffff
5
+ while b & mask :
6
+ a , b = a ^ b , (a & b )<< 1
7
+
8
+ max_int = 2 ** (32 - 1 ) - 1
9
+ if b < max_int :
10
+ return a
11
+ else :
12
+ # if there is overflow
13
+ # i.e if a is a negative value.
14
+ return a & mask
15
+ print (getSum (a ,b ))
Original file line number Diff line number Diff line change @@ -172,7 +172,7 @@ In the "Repository" you will find the topics and its problems.
172
172
173
173
| # | Title | Solution |
174
174
| --- | ---------------------------------------------------------------------------------------- | ------------------------------ |
175
- | 01 | [ Add] ( https://codeforces.com/group/MWSDmqGsZm/contest/223205/problem/A ) |
175
+ | 01 | [ Add] ( https://codeforces.com/group/MWSDmqGsZm/contest/223205/problem/A ) | [ Python ] ( ./Python/add.py ) |
176
176
| 02 | [ PRINT] ( https://codeforces.com/group/MWSDmqGsZm/contest/223205/problem/B ) |
177
177
| 03 | [ Different functions] ( https://codeforces.com/group/MWSDmqGsZm/contest/223205/problem/C ) |
178
178
| 04 | [ prime function] ( https://codeforces.com/group/MWSDmqGsZm/contest/223205/problem/D ) |
You can’t perform that action at this time.
0 commit comments