Submission #5796619
Source Code Expand
#include<iostream>
using namespace std;
int C[3][32];
int main()
{
int A, B;
while(cin >> A >> B, A!=0 || B!=0) {
for(int i=0; i<32; ++i) {
C[0][i] = (A >> i) & 1;
C[1][i] = (B >> i) & 1;
}
for(int i=0; i<32; ++i) {
if(C[0][i] + C[1][i] >= 2) {
C[C[1][i-1] & 1][i+1]++;
C[0][i]--;
C[1][i]--;
}
C[2][i] = C[0][i] + C[1][i];
}
int R = 0;
for(int i=0; i<32; ++i) {
R |= C[2][i] << i;
}
cout << R << endl;
}
return 0;
}
Submission Info
Submission Time |
|
Task |
A - A + B |
User |
luogu_bot1 |
Language |
C++ (GCC 5.4.1) |
Score |
0 |
Code Size |
557 Byte |
Status |
TLE |
Exec Time |
1055 ms |
Memory |
1536 KB |
Judge Result
Set Name |
Subtask1 |
Subtask2 |
Subtask3 |
Score / Max Score |
0 / 33 |
0 / 33 |
0 / 34 |
Status |
|
|
|
Set Name |
Test Cases |
Subtask1 |
1.txt |
Subtask2 |
2.txt |
Subtask3 |
3.txt |
Case Name |
Status |
Exec Time |
Memory |
1.txt |
TLE |
1055 ms |
1536 KB |
2.txt |
TLE |
1055 ms |
1536 KB |
3.txt |
TLE |
1055 ms |
1536 KB |