Compare commits
3 Commits
9fe04d95fe
...
5b739eda96
| Author | SHA1 | Date | |
|---|---|---|---|
| 5b739eda96 | |||
| 75d203cfd5 | |||
| b3565c8ef9 |
20
logicfunctions.cpp
Normal file
20
logicfunctions.cpp
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
#include "logicfunctions.h"
|
||||||
|
|
||||||
|
// Compute xor
|
||||||
|
void exclusive(bool x, bool y, bool& ans){
|
||||||
|
ans = x ^ y;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Compute implication
|
||||||
|
void implies(bool x, bool y, bool& ans){
|
||||||
|
if (!(x || y)) {
|
||||||
|
ans = true;
|
||||||
|
} else {
|
||||||
|
ans = y;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Compute equivalence
|
||||||
|
void equivalence(bool x, bool y, bool& ans){
|
||||||
|
ans = x == y;
|
||||||
|
}
|
||||||
1
modulo.py
Normal file
1
modulo.py
Normal file
@@ -0,0 +1 @@
|
|||||||
|
print(len(set([int(input()) % 42 for _ in range(10)])))
|
||||||
20
numberfun.py
Normal file
20
numberfun.py
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
def test_case(a: int, b: int, c: int) -> bool:
|
||||||
|
if a + b == c:
|
||||||
|
return True
|
||||||
|
elif a - b == c:
|
||||||
|
return True
|
||||||
|
elif b - a == c:
|
||||||
|
return True
|
||||||
|
elif a * b == c:
|
||||||
|
return True
|
||||||
|
elif c * a == b:
|
||||||
|
return True
|
||||||
|
elif c * b == a:
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
n = int(input())
|
||||||
|
for _ in range(n):
|
||||||
|
a, b, c = map(int, input().split())
|
||||||
|
print("Possible" if test_case(a, b, c) else "Impossible")
|
||||||
Reference in New Issue
Block a user