From: Skullheadx <704277@pdsb.net> Date: Sun, 25 Sep 2022 01:30:47 +0000 (-0400) Subject: 2022 S1, S2 X-Git-Url: http://git.skullheadx.com/nixos/static/pfp.webp?a=commitdiff_plain;h=f8b4a84bab1223bd554ef2402e9760cabd87e97d;p=CCC.git 2022 S1, S2 --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d9b0101 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +*.xml +*.iml + diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/CCC.iml b/.idea/CCC.iml new file mode 100644 index 0000000..82cb658 --- /dev/null +++ b/.idea/CCC.iml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..38750a3 --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,44 @@ + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..105ce2d --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..2d0cc4f --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..5250e3f --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Main/Python/2022/S1.py b/Main/Python/2022/S1.py new file mode 100644 index 0000000..ed59e8d --- /dev/null +++ b/Main/Python/2022/S1.py @@ -0,0 +1,14 @@ +N = int(input()) + +output = 0 + +seen = set() + +for i in range(int(1 + N/4)): + if (N - 4 * i) % 5 == 0: + num_fives = (N - 4 * i) / 5 + if (i,num_fives) not in seen: + output += 1 + seen.add((i,num_fives)) + +print(output) diff --git a/Main/Python/2022/S2.py b/Main/Python/2022/S2.py new file mode 100644 index 0000000..4409603 --- /dev/null +++ b/Main/Python/2022/S2.py @@ -0,0 +1,32 @@ +x = int(input()) +same = set() +for i in range(x): + a,b = input().split() + same.add((a,b)) + + +diff = set() +y = int(input()) +for i in range(y): + a,b = input().split() + diff.add((a,b)) + +groups = set() +g = int(input()) +for i in range(g): + a,b,c = input().split() + groups.add((a,b)) + groups.add((b,c)) + groups.add((a,c)) + +output = 0 +for i in same: + a,b = i + if not ((a,b) in groups or (b,a) in groups): + output += 1 +for i in diff: + a,b = i + if ((a,b) in groups) or ((b,a) in groups): + output += 1 + +print(output) diff --git a/Main/Python/S3.py b/Main/Python/S3.py new file mode 100644 index 0000000..06e3fbe --- /dev/null +++ b/Main/Python/S3.py @@ -0,0 +1,27 @@ +n,M,k = tuple(map(int, input().split())) + +# N number of notes +# M highest note +# K number good samples + +# best piece +# 1, 2, 1, 2, 1, 2 + +# MAX length of good sample = M +# number of good samples in pattern core = m*(m+1)/2 +output = -1 +for m in range(1,1+M): + # num_good = (m * (m+1) /2) * n//m + (n%m * (n%m+1)/2) + print(m, num_good) + if num_good == k: + output = m + break + +print(output) + +# input = 5 5 14 +# 1 2 3 4 1 +# 1, 2, 3, 4, 1,(5) +# 1 2, 2 3, 3 4, 4 1, (4) +# 1 2 3, 2 3 4, 3 4 1, (3) +# 1 2 3 4, 2 3 4 1 (2)