index
:
datalab2026
master
RUC ICS 2026 Datalab: Binary Representation and Bitwise Operations
about
summary
refs
log
tree
commit
diff
log msg
author
committer
range
diff options
context:
1
2
3
4
5
6
7
8
9
10
15
20
25
30
35
40
space:
include
ignore
mode:
unified
ssdiff
stat only
Diffstat
-rw-r--r--
bits.c
2
1 files changed, 1 insertions, 1 deletions
diff --git a/bits.c b/bits.c
index e283be3..951cc91 100644
--- a/
bits.c
+++ b/
bits.c
@@ -30,7 +30,7 @@ int bitAnd(int x, int y) {
* Difficulty: 1
*/
int bitXor(int x, int y) {
- return 2;
+ return ~(x & y) & ~(~x & ~y);
}
/*