Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion 2017/AUG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
| [AUG17](https://www.codechef.com/AUG17) | [RAINBOWA](https://www.codechef.com/AUG17/problems/RAINBOWA) | ★★ | | [![image](../img/GH.png)](AUG/AUG17/RAINBOWA/RAINBOWA.cpp) [![image](../img/CC.png)](https://www.codechef.com/viewsolution/14909134) (100 pts) [![image](../img/AC.png)](#) | [![image](../img/GH.png)](AUG/AUG17/RAINBOWA/RAINBOWA.java) [![image](../img/CC.png)](https://www.codechef.com/viewsolution/14859923) (100 pts) [![image](../img/AC.png)](#) | |
| [AUG17](https://www.codechef.com/AUG17) | [CHEFMOVR](https://www.codechef.com/AUG17/problems/CHEFMOVR) | ★★ | | | | |
| [AUG17](https://www.codechef.com/AUG17) | [GCAC](https://www.codechef.com/AUG17/problems/GCAC) | ★★★ | | [![image](../img/GH.png)](AUG/AUG17/GCAC/GCAC.cpp) [![image](../img/CC.png)](https://www.codechef.com/viewsolution/14947059) (100 pts) [![image](../img/AC.png)](#) | | |
| [AUG17](https://www.codechef.com/AUG17) | [PALINGAM](https://www.codechef.com/AUG17/problems/PALINGAM) | ★★★ | | [![image](../img/GH.png)](AUG/AUG17/PALINGAM/PALINGAM.cpp) [![image](../img/CC.png)](https://www.codechef.com/viewsolution/14908284) (100 pts) [![image](../img/AC.png)](#) | | |
| [AUG17](https://www.codechef.com/AUG17) | [PALINGAM](https://www.codechef.com/AUG17/problems/PALINGAM) | ★★★ | | [![image](../img/GH.png)](AUG/AUG17/PALINGAM/PALINGAM.cpp)  [![image](../img/CC.png)](https://www.codechef.com/viewsolution/14908284) (100 pts) [![image](../img/AC.png)](#) | | [![image](../img/GH.png)](AUG/AUG16/PALINGAM/PALINGAM.py) [![image](../img/CC.png)](https://www.codechef.com/viewsolution/15596349) (100 pts) [![image](../img/AC.png)](#) |
| [AUG17](https://www.codechef.com/AUG17) | [CHEFFA](https://www.codechef.com/AUG17/problems/CHEFFA) | ★★★★ | | | | |
| [AUG17](https://www.codechef.com/AUG17) | [STRINGRA](https://www.codechef.com/AUG17/problems/STRINGRA) | ★★★★ | | | | |
| [AUG17](https://www.codechef.com/AUG17) | [MATDW](https://www.codechef.com/AUG17/problems/MATDW) | ★★★★ | | | | |
Expand Down
28 changes: 28 additions & 0 deletions 2017/AUG/AUG17/PALINGAM/palingam.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
t = int(input())
while t > 0:
a = input()
b = input()
la = list()
lb = list()
la = 26 * [0]
lb = 26 * [0]
sa = set()
sb = set()
for i in range(len(a)):
la[ord(a[i]) - ord('a')] += 1
lb[ord(b[i]) - ord('a')] += 1
sa.add(a[i])
sb.add(b[i])
p = int(1)
for i in range(26):
if la[i] > 1 and lb[i] == 0:
p = 0
print("A")
break
elif sb.issubset(sa) and not(sb.issuperset(sa)):
print("A")
p = 0
break
if p == 1:
print("B")
t -= 1
19 changes: 19 additions & 0 deletions 2017/AUG/COOK85/OBTTRNGL/OBTTRNGL.PY
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
def main():
t = int(input())
for i in range(t):
n,x,y = map(int ,input().split())
a = min(x,y)
b = max(x,y)
b = b - a + 1
a = 1
if (n%2 == 0 and n/2 == b - a) or (b - a == 1 or b == n):
print("0")
else:
if b > n/2 + 1:
print(n - b)
elif b < n/2 + 1:
print(b - 2)


if __name__ == '__main__':
main()