]> Skullheadx's Git Forge - CCC.git/commitdiff
2022 S1, S2
authorSkullheadx <704277@pdsb.net>
Sun, 25 Sep 2022 01:30:47 +0000 (21:30 -0400)
committerSkullheadx <704277@pdsb.net>
Sun, 25 Sep 2022 01:30:47 +0000 (21:30 -0400)
.gitignore [new file with mode: 0644]
.idea/.gitignore [new file with mode: 0644]
.idea/CCC.iml [new file with mode: 0644]
.idea/inspectionProfiles/Project_Default.xml [new file with mode: 0644]
.idea/inspectionProfiles/profiles_settings.xml [new file with mode: 0644]
.idea/misc.xml [new file with mode: 0644]
.idea/modules.xml [new file with mode: 0644]
.idea/vcs.xml [new file with mode: 0644]
Main/Python/2022/S1.py [new file with mode: 0644]
Main/Python/2022/S2.py [new file with mode: 0644]
Main/Python/S3.py [new file with mode: 0644]

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..d9b0101
--- /dev/null
@@ -0,0 +1,3 @@
+*.xml
+*.iml
+
diff --git a/.idea/.gitignore b/.idea/.gitignore
new file mode 100644 (file)
index 0000000..13566b8
--- /dev/null
@@ -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 (file)
index 0000000..82cb658
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="PYTHON_MODULE" version="4">
+  <component name="NewModuleRootManager">
+    <content url="file://$MODULE_DIR$">
+      <excludeFolder url="file://$MODULE_DIR$/Main/venv" />
+    </content>
+    <orderEntry type="jdk" jdkName="Python 3.10 (CCC)" jdkType="Python SDK" />
+    <orderEntry type="sourceFolder" forTests="false" />
+  </component>
+</module>
\ No newline at end of file
diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml
new file mode 100644 (file)
index 0000000..38750a3
--- /dev/null
@@ -0,0 +1,44 @@
+<component name="InspectionProjectProfileManager">
+  <profile version="1.0">
+    <option name="myName" value="Project Default" />
+    <inspection_tool class="DuplicatedCode" enabled="true" level="WEAK WARNING" enabled_by_default="true">
+      <Languages>
+        <language minSize="61" name="Python" />
+      </Languages>
+    </inspection_tool>
+    <inspection_tool class="PyPackageRequirementsInspection" enabled="true" level="WARNING" enabled_by_default="true">
+      <option name="ignoredPackages">
+        <value>
+          <list size="8">
+            <item index="0" class="java.lang.String" itemvalue="tkinter" />
+            <item index="1" class="java.lang.String" itemvalue="random" />
+            <item index="2" class="java.lang.String" itemvalue="abc" />
+            <item index="3" class="java.lang.String" itemvalue="os" />
+            <item index="4" class="java.lang.String" itemvalue="functools" />
+            <item index="5" class="java.lang.String" itemvalue="threading" />
+            <item index="6" class="java.lang.String" itemvalue="math" />
+            <item index="7" class="java.lang.String" itemvalue="time" />
+          </list>
+        </value>
+      </option>
+    </inspection_tool>
+    <inspection_tool class="PyPep8NamingInspection" enabled="true" level="WEAK WARNING" enabled_by_default="true">
+      <option name="ignoredErrors">
+        <list>
+          <option value="N802" />
+          <option value="N806" />
+          <option value="N803" />
+        </list>
+      </option>
+    </inspection_tool>
+    <inspection_tool class="PyUnresolvedReferencesInspection" enabled="true" level="WARNING" enabled_by_default="true">
+      <option name="ignoredIdentifiers">
+        <list>
+          <option value="str.__setitem__" />
+          <option value="int.*" />
+          <option value="World.file_contents" />
+        </list>
+      </option>
+    </inspection_tool>
+  </profile>
+</component>
\ No newline at end of file
diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml
new file mode 100644 (file)
index 0000000..105ce2d
--- /dev/null
@@ -0,0 +1,6 @@
+<component name="InspectionProjectProfileManager">
+  <settings>
+    <option name="USE_PROJECT_PROFILE" value="false" />
+    <version value="1.0" />
+  </settings>
+</component>
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644 (file)
index 0000000..2d0cc4f
--- /dev/null
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectRootManager" version="2" project-jdk-name="Python 3.10 (CCC)" project-jdk-type="Python SDK" />
+</project>
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
new file mode 100644 (file)
index 0000000..5250e3f
--- /dev/null
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectModuleManager">
+    <modules>
+      <module fileurl="file://$PROJECT_DIR$/.idea/CCC.iml" filepath="$PROJECT_DIR$/.idea/CCC.iml" />
+    </modules>
+  </component>
+</project>
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644 (file)
index 0000000..94a25f7
--- /dev/null
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="VcsDirectoryMappings">
+    <mapping directory="$PROJECT_DIR$" vcs="Git" />
+  </component>
+</project>
\ No newline at end of file
diff --git a/Main/Python/2022/S1.py b/Main/Python/2022/S1.py
new file mode 100644 (file)
index 0000000..ed59e8d
--- /dev/null
@@ -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 (file)
index 0000000..4409603
--- /dev/null
@@ -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 (file)
index 0000000..06e3fbe
--- /dev/null
@@ -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)