about summary refs log tree commit diff
path: root/codechef/jain.py
diff options
context:
space:
mode:
authorNguyễn Gia Phong <vn.mcsinyx@gmail.com>2019-03-13 09:13:11 +0700
committerNguyễn Gia Phong <vn.mcsinyx@gmail.com>2019-03-13 09:13:11 +0700
commit86fd670f4d4ac634a8c9740ff9129b589afcec1a (patch)
tree3d6e01efae1b4425f0815a0b213aca6331194818 /codechef/jain.py
parent477c426b55d168764a34873561f78b3c34b1f013 (diff)
downloadcp-86fd670f4d4ac634a8c9740ff9129b589afcec1a.tar.gz
Guess my rank is gonna plummet again
Diffstat (limited to 'codechef/jain.py')
-rwxr-xr-xcodechef/jain.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/codechef/jain.py b/codechef/jain.py
new file mode 100755
index 0000000..8601072
--- /dev/null
+++ b/codechef/jain.py
@@ -0,0 +1,6 @@
+#!/usr/bin/env python3
+from itertools import combinations
+
+for _ in range(int(input())):
+    print(sum(len(a | b) == 5 for a, b in combinations(
+        (set(input()) for d in range(int(input()))), 2)))