From 6f2c3fb9ca517b5cc2015ae7b32a4398d8145373 Mon Sep 17 00:00:00 2001 From: simjoon Date: Fri, 4 Mar 2022 21:27:16 +0900 Subject: [PATCH 01/50] tst --- .vscode/c_cpp_properties.json | 21 +++++++++++++++++++++ .vscode/tasks.json | 29 +++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 .vscode/c_cpp_properties.json create mode 100644 .vscode/tasks.json diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json new file mode 100644 index 0000000..e173bd5 --- /dev/null +++ b/.vscode/c_cpp_properties.json @@ -0,0 +1,21 @@ +{ + "configurations": [ + { + "name": "Win32", + "includePath": [ + "${workspaceFolder}/**" + ], + "defines": [ + "_DEBUG", + "UNICODE", + "_UNICODE" + ], + "windowsSdkVersion": "10.0.19041.0", + "compilerPath": "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.30.30705\\bin\\Hostx64\\x64\\cl.exe", + "cStandard": "c17", + "cppStandard": "c++17", + "intelliSenseMode": "windows-msvc-x64" + } + ], + "version": 4 +} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..7d9df8e --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,29 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "type": "cppbuild", + "label": "C/C++: cl.exe 활성 파일 빌드", + "command": "cl.exe", + "args": [ + "/Zi", + "/EHsc", + "/nologo", + "/Fe:", + "${fileDirname}\\${fileBasenameNoExtension}.exe", + "${file}" + ], + "options": { + "cwd": "${fileDirname}" + }, + "problemMatcher": [ + "$msCompile" + ], + "group": { + "kind": "build", + "isDefault": true + }, + "detail": "컴파일러: cl.exe" + } + ] +} \ No newline at end of file From 2de2f5597005a3191ff9a6fe0ec848aee677f960 Mon Sep 17 00:00:00 2001 From: simjoon Date: Fri, 4 Mar 2022 22:59:12 +0900 Subject: [PATCH 02/50] message --- .../.vscode/tasks.json" | 136 ++++++++++++++++++ .../11557.py" | 13 ++ .../test.cpp" | 10 ++ .../test.exe" | Bin 0 -> 44836 bytes 4 files changed, 159 insertions(+) create mode 100644 "sources/wesly2003_\354\213\254\354\244\200/.vscode/tasks.json" create mode 100644 "sources/wesly2003_\354\213\254\354\244\200/11557.py" create mode 100644 "sources/wesly2003_\354\213\254\354\244\200/test.exe" diff --git "a/sources/wesly2003_\354\213\254\354\244\200/.vscode/tasks.json" "b/sources/wesly2003_\354\213\254\354\244\200/.vscode/tasks.json" new file mode 100644 index 0000000..9e87d74 --- /dev/null +++ "b/sources/wesly2003_\354\213\254\354\244\200/.vscode/tasks.json" @@ -0,0 +1,136 @@ +{ + "version": "2.0.0", + "runner": "terminal", + "type": "shell", + "echoCommand": true, + "presentation": { + "reveal": "always" + }, + "tasks": [ + { + "label": "save and compile for C++", + "command": "g++", + "args": [ + "${file}", + "-o", + "${fileDirname}/${fileBasenameNoExtension}" + ], + "group": "build", + "problemMatcher": { + "fileLocation": [ + "relative", + "${workspaceRoot}" + ], + "pattern": { + "regexp": "^(.*):(\\d+):(\\d+):\\s+(warning error):\\s+(.*)$", + "file": 1, + "line": 2, + "column": 3, + "severity": 4, + "message": 5 + } + } + }, + { + "label": "save and compile for C", + "command": "gcc", + "args": [ + "${file}", + "-o", + "${fileDirname}/${fileBasenameNoExtension}" + ], + "group": "build", + "problemMatcher": { + "fileLocation": [ + "relative", + "${workspaceRoot}" + ], + "pattern": { + "regexp": "^(.*):(\\d+):(\\d+):\\s+(warning error):\\s+(.*)$", + "file": 1, + "line": 2, + "column": 3, + "severity": 4, + "message": 5 + } + } + }, + { + "label": "execute", + "command": "cmd", + "group": "test", + "args": [ + "/C", + "${fileDirname}\\${fileBasenameNoExtension}" + ] + }, + { + "type": "cppbuild", + "label": "C/C++: gcc.exe 활성 파일 빌드", + "command": "C:\\MinGW\\bin\\gcc.exe", + "args": [ + "-g", + "${file}", + "-o", + "${fileDirname}\\${fileBasenameNoExtension}.exe" + ], + "options": { + "cwd": "${fileDirname}" + }, + "problemMatcher": [ + "$gcc" + ], + "group": "build", + "detail": "디버거에서 생성된 작업입니다." + }, + { + "type": "cppbuild", + "label": "C/C++: g++.exe 활성 파일 빌드", + "command": "C:\\MinGW\\bin\\g++.exe", + "args": [ + "-g", + "${file}", + "-o", + "${fileDirname}\\${fileBasenameNoExtension}.exe" + ], + "options": { + "cwd": "${fileDirname}" + }, + "problemMatcher": [ + "$gcc" + ], + "group": "build", +// "group": { +// "kind": "build", +// "isDefault": true +// }, + + "detail": "디버거에서 생성된 작업입니다." + }, + { + "type": "cppbuild", + "label": "C/C++: gcc.exe 활성 파일 빌드", + "command": "C:\\MinGW\\bin\\gcc.exe", + "args": [ + "-g", + "${file}", + "-o", + "${fileDirname}\\${fileBasenameNoExtension}.exe" + ], + "options": { + "cwd": "${fileDirname}" + }, + "problemMatcher": [ + "$gcc" + ], + "group": "build", + + // "group": { + // "kind": "build", + // "isDefault": true + // }, + + "detail": "컴파일러: C:\\MinGW\\bin\\gcc.exe" + } + ] +} \ No newline at end of file diff --git "a/sources/wesly2003_\354\213\254\354\244\200/11557.py" "b/sources/wesly2003_\354\213\254\354\244\200/11557.py" new file mode 100644 index 0000000..a5ecf86 --- /dev/null +++ "b/sources/wesly2003_\354\213\254\354\244\200/11557.py" @@ -0,0 +1,13 @@ +T = int(input()) + +while T > 0 : + T-=1 + N = int(input()) + max = -1 + school = "" + for i in range(N) : + name, num = str(input()).split() + if(int(num) > max): + max=int(num) + school = name + print(school) \ No newline at end of file diff --git "a/sources/wesly2003_\354\213\254\354\244\200/test.cpp" "b/sources/wesly2003_\354\213\254\354\244\200/test.cpp" index e69de29..8a705f9 100644 --- "a/sources/wesly2003_\354\213\254\354\244\200/test.cpp" +++ "b/sources/wesly2003_\354\213\254\354\244\200/test.cpp" @@ -0,0 +1,10 @@ +#include +using namespace std; + +int main(){ + ios::sync_with_stdio(false); + cin.tie(NULL); + cout.tie(NULL); + cout<<"asd"; + return 0; +} \ No newline at end of file diff --git "a/sources/wesly2003_\354\213\254\354\244\200/test.exe" "b/sources/wesly2003_\354\213\254\354\244\200/test.exe" new file mode 100644 index 0000000000000000000000000000000000000000..11793b7c8fe7eeb4ebf6098650948c2c0b05572a GIT binary patch literal 44836 zcmeHw4SZD9nfIBGkb#8U1cIWX4mKz#1cHD;W1UGd`H*~>N%&Ckl8*_AOg>ER@S!5X zNtC;@>1KEJZFkr1N^y7DzP7bnH)6Fm5KKU+jYyRi>!MOSF|?(AU;yj9|L2^0=g!R} zwr}6}{q6qV_QK6Q=Q+=LzRq)=bMCqKo+-Vvm)RI&cASw2WBYNX!^Qu8@t;lY@cXIp#gruLdj*Zu@!vnQyyZ5MzLWwIkv@oiI3xNRZ+ zkU*qsR0*VUY-AN1GwW-V8l>kCz=ab!v!ys=4i{U}pV=-Dlc_N)a1yO$F-S-P&$U>C zrA`B2BhF-;**Iek!pp4f=pYcu$lB;n{Lx8#n*?8O!%pBhaORtFxqNw*RRra>>P3R| zptg-UIG*C?e4PY;0w>{>;fy&5Z*i7Tgp2+(3JH(&jyYV+mAiQ9N)CyT0sC=Yg|iZ8 z%;93Gxr>)&amZq7vr{;U-Z;HE-ty%rVC*pAoyAFb?Koo&j<@0_4iTmWGU0J!8i>#% z*U0_Xq=IMWgz__-Ar@k{{xvMLwd~d&Tsk)1nt+SceH3C1JJ{8bI{IuwfwD*f{app>;E8XT`Dkc{aYjhZ^jTMmkEb- zqTfQUyI<)8H!6q>?~mXZ-PhBHT&yg-T9v34_z}^gHqokuZ$SaCIkFkm)pI>BTu1e9 zy^^a{4Ool>q+WQcAf>E>N?pqc!Or#8BpCS;K)sp`beN>kiRFA?0hfZfg})`~QvBj` z!BNBH9KQ<8;Ni%~5px+g^8H%bw@}ujT+1~1tJPn4gJ;tB_$ypwr8!W7?7;0pE(ZB1 z8yOCsNv3qFi-k`RsWbL4L!8^=aJiUj&j`Q8CF5CD*y|B8Gk~vIEB>k9)y9gU>AYgbQl@MLW9tM6yY>%B1 zsCoi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 Mar 2022 23:47:12 +0900 Subject: [PATCH 03/50] init --- .../1110.py" | 19 +++++++++++++++++++ .../10926.py" | 2 ++ .../18108.py" | 2 ++ .../14681.py" | 13 +++++++++++++ .../2480.py" | 13 +++++++++++++ .../2525.py" | 8 ++++++++ 6 files changed, 57 insertions(+) create mode 100644 "sources/cometj03_\354\240\225\355\225\264\354\204\261/\353\260\230\353\263\265\353\254\270/1110.py" create mode 100644 "sources/cometj03_\354\240\225\355\225\264\354\204\261/\354\236\205\354\266\234\353\240\245\352\263\274 \354\202\254\354\271\231\354\227\260\354\202\260/10926.py" create mode 100644 "sources/cometj03_\354\240\225\355\225\264\354\204\261/\354\236\205\354\266\234\353\240\245\352\263\274 \354\202\254\354\271\231\354\227\260\354\202\260/18108.py" create mode 100644 "sources/cometj03_\354\240\225\355\225\264\354\204\261/\354\241\260\352\261\264\353\254\270/14681.py" create mode 100644 "sources/cometj03_\354\240\225\355\225\264\354\204\261/\354\241\260\352\261\264\353\254\270/2480.py" create mode 100644 "sources/cometj03_\354\240\225\355\225\264\354\204\261/\354\241\260\352\261\264\353\254\270/2525.py" diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/\353\260\230\353\263\265\353\254\270/1110.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/\353\260\230\353\263\265\353\254\270/1110.py" new file mode 100644 index 0000000..cf2412f --- /dev/null +++ "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/\353\260\230\353\263\265\353\254\270/1110.py" @@ -0,0 +1,19 @@ +start = int(input()) + +def hap(n): + if n < 10: + return n + return n % 10 + n // 10 + +A = start +count = 0 + +while True: + count += 1 + B = hap(A) + new_num = A % 10 * 10 + B % 10 + A = new_num + if start == new_num: + break + +print(count) \ No newline at end of file diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/\354\236\205\354\266\234\353\240\245\352\263\274 \354\202\254\354\271\231\354\227\260\354\202\260/10926.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/\354\236\205\354\266\234\353\240\245\352\263\274 \354\202\254\354\271\231\354\227\260\354\202\260/10926.py" new file mode 100644 index 0000000..e5265e5 --- /dev/null +++ "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/\354\236\205\354\266\234\353\240\245\352\263\274 \354\202\254\354\271\231\354\227\260\354\202\260/10926.py" @@ -0,0 +1,2 @@ +s = input() +print(s + '??!') \ No newline at end of file diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/\354\236\205\354\266\234\353\240\245\352\263\274 \354\202\254\354\271\231\354\227\260\354\202\260/18108.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/\354\236\205\354\266\234\353\240\245\352\263\274 \354\202\254\354\271\231\354\227\260\354\202\260/18108.py" new file mode 100644 index 0000000..e1187a4 --- /dev/null +++ "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/\354\236\205\354\266\234\353\240\245\352\263\274 \354\202\254\354\271\231\354\227\260\354\202\260/18108.py" @@ -0,0 +1,2 @@ +n = int(input()) +print(n - 543) \ No newline at end of file diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/\354\241\260\352\261\264\353\254\270/14681.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/\354\241\260\352\261\264\353\254\270/14681.py" new file mode 100644 index 0000000..d184efa --- /dev/null +++ "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/\354\241\260\352\261\264\353\254\270/14681.py" @@ -0,0 +1,13 @@ +x = int(input()) +y = int(input()) + +if x > 0: + if y > 0: + print(1) + else: + print(4) +else: + if y > 0: + print(2) + else: + print(3) \ No newline at end of file diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/\354\241\260\352\261\264\353\254\270/2480.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/\354\241\260\352\261\264\353\254\270/2480.py" new file mode 100644 index 0000000..6310f41 --- /dev/null +++ "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/\354\241\260\352\261\264\353\254\270/2480.py" @@ -0,0 +1,13 @@ +a, b, c = map(int, input().split()) + +s = set([a, b, c]) + +if len(s) == 1: + num = max(s) + print(10000 + num*1000) +elif len(s) == 3: + num = max(s) + print(num*100) +else: + num = a + b + c - sum(s) + print(1000 + num*100) \ No newline at end of file diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/\354\241\260\352\261\264\353\254\270/2525.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/\354\241\260\352\261\264\353\254\270/2525.py" new file mode 100644 index 0000000..9f45627 --- /dev/null +++ "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/\354\241\260\352\261\264\353\254\270/2525.py" @@ -0,0 +1,8 @@ +h, m = map(int, input().split()) +c = int(input()) + +time = h * 60 + m + c + +nh = time // 60 % 24 +nm = time % 60 +print(nh, nm) \ No newline at end of file From 872b40d709f7daed7d3f4a3f05adee4b3273b7b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A0=95=ED=95=B4=EC=84=B1?= Date: Thu, 31 Mar 2022 23:56:38 +0900 Subject: [PATCH 04/50] algorithm step4 --- .../a.py" | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 "sources/cometj03_\354\240\225\355\225\264\354\204\261/1\354\260\250\354\233\220 \353\260\260\354\227\264/a.py" diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/1\354\260\250\354\233\220 \353\260\260\354\227\264/a.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/1\354\260\250\354\233\220 \353\260\260\354\227\264/a.py" new file mode 100644 index 0000000..62650f2 --- /dev/null +++ "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/1\354\260\250\354\233\220 \353\260\260\354\227\264/a.py" @@ -0,0 +1,44 @@ +# 2577 숫자의 개수 +'''a = int(input()) +b = int(input()) +c = int(input()) + +s = str(a*b*c) + +for i in range(10): + print(s.count(str(i)))''' + +# 3052 나머지 +'''s = set() + +for i in range(10): + n = int(input()) + s.add(n%42) + +print(len(s))''' + +# 1546 평균 +'''n = int(input()) +scores = list(map(int, input().split())) + +m = max(scores) +newscore = list(map(lambda x: x/m * 100, scores)) + +print(sum(newscore)/n)''' + +# 4344 평균은 넘겠지 +n = int(input()) +while n > 0: + n -= 1 + t = list(map(int, input().split())) + scores = t[1:] + scores.sort() + mean = sum(scores) / t[0] + + i = 0 + while t[0] > i: + if scores[i] > mean: + break + i += 1 + p = (t[0] - i) / t[0] * 100 + print('%.3f%%' % p) \ No newline at end of file From 1c43ed45431319a7b4b4fbeba9ce48a3ce7e3465 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A0=95=ED=95=B4=EC=84=B1?= Date: Thu, 31 Mar 2022 23:59:18 +0900 Subject: [PATCH 05/50] algorithm step4 --- .../a.py" | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 "sources/cometj03_\354\240\225\355\225\264\354\204\261/1\354\260\250\354\233\220 \353\260\260\354\227\264/a.py" diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/1\354\260\250\354\233\220 \353\260\260\354\227\264/a.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/1\354\260\250\354\233\220 \353\260\260\354\227\264/a.py" new file mode 100644 index 0000000..62650f2 --- /dev/null +++ "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/1\354\260\250\354\233\220 \353\260\260\354\227\264/a.py" @@ -0,0 +1,44 @@ +# 2577 숫자의 개수 +'''a = int(input()) +b = int(input()) +c = int(input()) + +s = str(a*b*c) + +for i in range(10): + print(s.count(str(i)))''' + +# 3052 나머지 +'''s = set() + +for i in range(10): + n = int(input()) + s.add(n%42) + +print(len(s))''' + +# 1546 평균 +'''n = int(input()) +scores = list(map(int, input().split())) + +m = max(scores) +newscore = list(map(lambda x: x/m * 100, scores)) + +print(sum(newscore)/n)''' + +# 4344 평균은 넘겠지 +n = int(input()) +while n > 0: + n -= 1 + t = list(map(int, input().split())) + scores = t[1:] + scores.sort() + mean = sum(scores) / t[0] + + i = 0 + while t[0] > i: + if scores[i] > mean: + break + i += 1 + p = (t[0] - i) / t[0] * 100 + print('%.3f%%' % p) \ No newline at end of file From 1e8f83d9a970cd380b8fedf4da7ab8fc51bb03cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A0=95=ED=95=B4=EC=84=B1?= Date: Fri, 1 Apr 2022 00:01:19 +0900 Subject: [PATCH 06/50] delete folder --- .../a.py" | 44 ------------------- 1 file changed, 44 deletions(-) delete mode 100644 "sources/cometj03_\354\240\225\355\225\264\354\204\261/1\354\260\250\354\233\220 \353\260\260\354\227\264/a.py" diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/1\354\260\250\354\233\220 \353\260\260\354\227\264/a.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/1\354\260\250\354\233\220 \353\260\260\354\227\264/a.py" deleted file mode 100644 index 62650f2..0000000 --- "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/1\354\260\250\354\233\220 \353\260\260\354\227\264/a.py" +++ /dev/null @@ -1,44 +0,0 @@ -# 2577 숫자의 개수 -'''a = int(input()) -b = int(input()) -c = int(input()) - -s = str(a*b*c) - -for i in range(10): - print(s.count(str(i)))''' - -# 3052 나머지 -'''s = set() - -for i in range(10): - n = int(input()) - s.add(n%42) - -print(len(s))''' - -# 1546 평균 -'''n = int(input()) -scores = list(map(int, input().split())) - -m = max(scores) -newscore = list(map(lambda x: x/m * 100, scores)) - -print(sum(newscore)/n)''' - -# 4344 평균은 넘겠지 -n = int(input()) -while n > 0: - n -= 1 - t = list(map(int, input().split())) - scores = t[1:] - scores.sort() - mean = sum(scores) / t[0] - - i = 0 - while t[0] > i: - if scores[i] > mean: - break - i += 1 - p = (t[0] - i) / t[0] * 100 - print('%.3f%%' % p) \ No newline at end of file From b9b1f5354458df0cea50cd82c37ad4cabd4ab2ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A0=95=ED=95=B4=EC=84=B1?= Date: Tue, 5 Apr 2022 20:53:45 +0900 Subject: [PATCH 07/50] Array and Function --- .../1546.py" | 8 ++++ .../2577.py" | 9 ++++ .../3052.py" | 8 ++++ .../4344.py" | 16 +++++++ .../a.py" | 44 ------------------- .../\355\225\250\354\210\230/1065.py" | 22 ++++++++++ .../\355\225\250\354\210\230/15596.py" | 3 ++ .../\355\225\250\354\210\230/4673.py" | 12 +++++ 8 files changed, 78 insertions(+), 44 deletions(-) create mode 100644 "sources/cometj03_\354\240\225\355\225\264\354\204\261/1\354\260\250\354\233\220 \353\260\260\354\227\264/1546.py" create mode 100644 "sources/cometj03_\354\240\225\355\225\264\354\204\261/1\354\260\250\354\233\220 \353\260\260\354\227\264/2577.py" create mode 100644 "sources/cometj03_\354\240\225\355\225\264\354\204\261/1\354\260\250\354\233\220 \353\260\260\354\227\264/3052.py" create mode 100644 "sources/cometj03_\354\240\225\355\225\264\354\204\261/1\354\260\250\354\233\220 \353\260\260\354\227\264/4344.py" delete mode 100644 "sources/cometj03_\354\240\225\355\225\264\354\204\261/1\354\260\250\354\233\220 \353\260\260\354\227\264/a.py" create mode 100644 "sources/cometj03_\354\240\225\355\225\264\354\204\261/\355\225\250\354\210\230/1065.py" create mode 100644 "sources/cometj03_\354\240\225\355\225\264\354\204\261/\355\225\250\354\210\230/15596.py" create mode 100644 "sources/cometj03_\354\240\225\355\225\264\354\204\261/\355\225\250\354\210\230/4673.py" diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/1\354\260\250\354\233\220 \353\260\260\354\227\264/1546.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/1\354\260\250\354\233\220 \353\260\260\354\227\264/1546.py" new file mode 100644 index 0000000..de72dac --- /dev/null +++ "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/1\354\260\250\354\233\220 \353\260\260\354\227\264/1546.py" @@ -0,0 +1,8 @@ +# 1546 평균 +n = int(input()) +scores = list(map(int, input().split())) + +m = max(scores) +newscore = list(map(lambda x: x/m * 100, scores)) + +print(sum(newscore)/n) \ No newline at end of file diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/1\354\260\250\354\233\220 \353\260\260\354\227\264/2577.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/1\354\260\250\354\233\220 \353\260\260\354\227\264/2577.py" new file mode 100644 index 0000000..eebb186 --- /dev/null +++ "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/1\354\260\250\354\233\220 \353\260\260\354\227\264/2577.py" @@ -0,0 +1,9 @@ +# 2577 숫자의 개수 +a = int(input()) +b = int(input()) +c = int(input()) + +s = str(a*b*c) + +for i in range(10): + print(s.count(str(i))) \ No newline at end of file diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/1\354\260\250\354\233\220 \353\260\260\354\227\264/3052.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/1\354\260\250\354\233\220 \353\260\260\354\227\264/3052.py" new file mode 100644 index 0000000..bd83dc0 --- /dev/null +++ "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/1\354\260\250\354\233\220 \353\260\260\354\227\264/3052.py" @@ -0,0 +1,8 @@ +# 3052 나머지 +s = set() + +for i in range(10): + n = int(input()) + s.add(n%42) + +print(len(s)) \ No newline at end of file diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/1\354\260\250\354\233\220 \353\260\260\354\227\264/4344.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/1\354\260\250\354\233\220 \353\260\260\354\227\264/4344.py" new file mode 100644 index 0000000..4bbf783 --- /dev/null +++ "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/1\354\260\250\354\233\220 \353\260\260\354\227\264/4344.py" @@ -0,0 +1,16 @@ +# 4344 평균은 넘겠지 +n = int(input()) +while n > 0: + n -= 1 + t = list(map(int, input().split())) + scores = t[1:] + scores.sort() + mean = sum(scores) / t[0] + + i = 0 + while t[0] > i: + if scores[i] > mean: + break + i += 1 + p = (t[0] - i) / t[0] * 100 + print('%.3f%%' % p) \ No newline at end of file diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/1\354\260\250\354\233\220 \353\260\260\354\227\264/a.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/1\354\260\250\354\233\220 \353\260\260\354\227\264/a.py" deleted file mode 100644 index 62650f2..0000000 --- "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/1\354\260\250\354\233\220 \353\260\260\354\227\264/a.py" +++ /dev/null @@ -1,44 +0,0 @@ -# 2577 숫자의 개수 -'''a = int(input()) -b = int(input()) -c = int(input()) - -s = str(a*b*c) - -for i in range(10): - print(s.count(str(i)))''' - -# 3052 나머지 -'''s = set() - -for i in range(10): - n = int(input()) - s.add(n%42) - -print(len(s))''' - -# 1546 평균 -'''n = int(input()) -scores = list(map(int, input().split())) - -m = max(scores) -newscore = list(map(lambda x: x/m * 100, scores)) - -print(sum(newscore)/n)''' - -# 4344 평균은 넘겠지 -n = int(input()) -while n > 0: - n -= 1 - t = list(map(int, input().split())) - scores = t[1:] - scores.sort() - mean = sum(scores) / t[0] - - i = 0 - while t[0] > i: - if scores[i] > mean: - break - i += 1 - p = (t[0] - i) / t[0] * 100 - print('%.3f%%' % p) \ No newline at end of file diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/\355\225\250\354\210\230/1065.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/\355\225\250\354\210\230/1065.py" new file mode 100644 index 0000000..0bc7bc9 --- /dev/null +++ "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/\355\225\250\354\210\230/1065.py" @@ -0,0 +1,22 @@ +# 1065 한수 +def isHansu(n): + newList = list(map(int, str(n))) + + length = len(newList) + if length <= 2: + return True + + d = newList[0] - newList[1] + for i in range(1, length - 1): + if newList[i] - newList[i+1] != d: + return False + return True + +N = int(input()) + +count = 0 +for i in range(1, N+1): + if isHansu(i): + count += 1 + +print(count) \ No newline at end of file diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/\355\225\250\354\210\230/15596.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/\355\225\250\354\210\230/15596.py" new file mode 100644 index 0000000..dc24d44 --- /dev/null +++ "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/\355\225\250\354\210\230/15596.py" @@ -0,0 +1,3 @@ +# 15596 정수 N개의 합 +def solve(a): + return sum(a) \ No newline at end of file diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/\355\225\250\354\210\230/4673.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/\355\225\250\354\210\230/4673.py" new file mode 100644 index 0000000..e480721 --- /dev/null +++ "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/\355\225\250\354\210\230/4673.py" @@ -0,0 +1,12 @@ +# 4673 셀프 넘버 +selfnum = [False] * 10100 + +def d(n): + return n + sum(map(int, str(n))) + +for i in range(1, 10001): + selfnum[d(i)] = True + +for i in range(1, 10001): + if not selfnum[i]: + print(i) \ No newline at end of file From 054510524b794ff48c5654f04ebf685811a16c16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A0=95=ED=95=B4=EC=84=B1?= Date: Wed, 6 Apr 2022 23:33:08 +0900 Subject: [PATCH 08/50] step 7 string --- .../\353\254\270\354\236\220\354\227\264/10809.py" | 9 +++++++++ .../\353\254\270\354\236\220\354\227\264/2908.py" | 3 +++ 2 files changed, 12 insertions(+) create mode 100644 "sources/cometj03_\354\240\225\355\225\264\354\204\261/\353\254\270\354\236\220\354\227\264/10809.py" create mode 100644 "sources/cometj03_\354\240\225\355\225\264\354\204\261/\353\254\270\354\236\220\354\227\264/2908.py" diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/\353\254\270\354\236\220\354\227\264/10809.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/\353\254\270\354\236\220\354\227\264/10809.py" new file mode 100644 index 0000000..6e5f217 --- /dev/null +++ "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/\353\254\270\354\236\220\354\227\264/10809.py" @@ -0,0 +1,9 @@ +S = input() +alphabets = "abcdefghijklmnopqrstuvwxyz" +indices = [-1] * 30 + +for i in range(len(alphabets)): + indices[i] = S.find(alphabets[i]) + +for i in range(len(alphabets)): + print(indices[i], end=' ') diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/\353\254\270\354\236\220\354\227\264/2908.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/\353\254\270\354\236\220\354\227\264/2908.py" new file mode 100644 index 0000000..0db1a7e --- /dev/null +++ "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/\353\254\270\354\236\220\354\227\264/2908.py" @@ -0,0 +1,3 @@ +# 2908 상수 +a, b = input().split() +print(max(int(a[::-1]), int(b[::-1]))) \ No newline at end of file From dc94e2153df1ad8084e6b5f51089b202b150a5bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A0=95=ED=95=B4=EC=84=B1?= Date: Thu, 7 Apr 2022 13:39:58 +0900 Subject: [PATCH 09/50] rearrangement --- .../step/1/10926.py" | 0 .../step/1/18108.py" | 0 .../step/2/14681.py" | 0 .../step/2/2480.py" | 0 .../step/2/2525.py" | 0 .../step/3/1110.py" | 0 .../step/4 array/1546.py" | 0 .../step/4 array/2577.py" | 0 .../step/4 array/3052.py" | 0 .../step/4 array/4344.py" | 0 .../step/5 function/1065.py" | 0 .../step/5 function/15596.py" | 0 .../step/5 function/4673.py" | 0 .../step/6 string/10809.py" | 1 + .../step/6 string/1157.py" | 1 + .../step/6 string/2908.py" | 0 16 files changed, 2 insertions(+) rename "sources/cometj03_\354\240\225\355\225\264\354\204\261/\354\236\205\354\266\234\353\240\245\352\263\274 \354\202\254\354\271\231\354\227\260\354\202\260/10926.py" => "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/1/10926.py" (100%) rename "sources/cometj03_\354\240\225\355\225\264\354\204\261/\354\236\205\354\266\234\353\240\245\352\263\274 \354\202\254\354\271\231\354\227\260\354\202\260/18108.py" => "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/1/18108.py" (100%) rename "sources/cometj03_\354\240\225\355\225\264\354\204\261/\354\241\260\352\261\264\353\254\270/14681.py" => "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/2/14681.py" (100%) rename "sources/cometj03_\354\240\225\355\225\264\354\204\261/\354\241\260\352\261\264\353\254\270/2480.py" => "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/2/2480.py" (100%) rename "sources/cometj03_\354\240\225\355\225\264\354\204\261/\354\241\260\352\261\264\353\254\270/2525.py" => "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/2/2525.py" (100%) rename "sources/cometj03_\354\240\225\355\225\264\354\204\261/\353\260\230\353\263\265\353\254\270/1110.py" => "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/3/1110.py" (100%) rename "sources/cometj03_\354\240\225\355\225\264\354\204\261/1\354\260\250\354\233\220 \353\260\260\354\227\264/1546.py" => "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/4 array/1546.py" (100%) rename "sources/cometj03_\354\240\225\355\225\264\354\204\261/1\354\260\250\354\233\220 \353\260\260\354\227\264/2577.py" => "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/4 array/2577.py" (100%) rename "sources/cometj03_\354\240\225\355\225\264\354\204\261/1\354\260\250\354\233\220 \353\260\260\354\227\264/3052.py" => "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/4 array/3052.py" (100%) rename "sources/cometj03_\354\240\225\355\225\264\354\204\261/1\354\260\250\354\233\220 \353\260\260\354\227\264/4344.py" => "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/4 array/4344.py" (100%) rename "sources/cometj03_\354\240\225\355\225\264\354\204\261/\355\225\250\354\210\230/1065.py" => "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/5 function/1065.py" (100%) rename "sources/cometj03_\354\240\225\355\225\264\354\204\261/\355\225\250\354\210\230/15596.py" => "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/5 function/15596.py" (100%) rename "sources/cometj03_\354\240\225\355\225\264\354\204\261/\355\225\250\354\210\230/4673.py" => "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/5 function/4673.py" (100%) rename "sources/cometj03_\354\240\225\355\225\264\354\204\261/\353\254\270\354\236\220\354\227\264/10809.py" => "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/6 string/10809.py" (89%) create mode 100644 "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/6 string/1157.py" rename "sources/cometj03_\354\240\225\355\225\264\354\204\261/\353\254\270\354\236\220\354\227\264/2908.py" => "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/6 string/2908.py" (100%) diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/\354\236\205\354\266\234\353\240\245\352\263\274 \354\202\254\354\271\231\354\227\260\354\202\260/10926.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/1/10926.py" similarity index 100% rename from "sources/cometj03_\354\240\225\355\225\264\354\204\261/\354\236\205\354\266\234\353\240\245\352\263\274 \354\202\254\354\271\231\354\227\260\354\202\260/10926.py" rename to "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/1/10926.py" diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/\354\236\205\354\266\234\353\240\245\352\263\274 \354\202\254\354\271\231\354\227\260\354\202\260/18108.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/1/18108.py" similarity index 100% rename from "sources/cometj03_\354\240\225\355\225\264\354\204\261/\354\236\205\354\266\234\353\240\245\352\263\274 \354\202\254\354\271\231\354\227\260\354\202\260/18108.py" rename to "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/1/18108.py" diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/\354\241\260\352\261\264\353\254\270/14681.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/2/14681.py" similarity index 100% rename from "sources/cometj03_\354\240\225\355\225\264\354\204\261/\354\241\260\352\261\264\353\254\270/14681.py" rename to "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/2/14681.py" diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/\354\241\260\352\261\264\353\254\270/2480.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/2/2480.py" similarity index 100% rename from "sources/cometj03_\354\240\225\355\225\264\354\204\261/\354\241\260\352\261\264\353\254\270/2480.py" rename to "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/2/2480.py" diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/\354\241\260\352\261\264\353\254\270/2525.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/2/2525.py" similarity index 100% rename from "sources/cometj03_\354\240\225\355\225\264\354\204\261/\354\241\260\352\261\264\353\254\270/2525.py" rename to "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/2/2525.py" diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/\353\260\230\353\263\265\353\254\270/1110.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/3/1110.py" similarity index 100% rename from "sources/cometj03_\354\240\225\355\225\264\354\204\261/\353\260\230\353\263\265\353\254\270/1110.py" rename to "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/3/1110.py" diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/1\354\260\250\354\233\220 \353\260\260\354\227\264/1546.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/4 array/1546.py" similarity index 100% rename from "sources/cometj03_\354\240\225\355\225\264\354\204\261/1\354\260\250\354\233\220 \353\260\260\354\227\264/1546.py" rename to "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/4 array/1546.py" diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/1\354\260\250\354\233\220 \353\260\260\354\227\264/2577.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/4 array/2577.py" similarity index 100% rename from "sources/cometj03_\354\240\225\355\225\264\354\204\261/1\354\260\250\354\233\220 \353\260\260\354\227\264/2577.py" rename to "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/4 array/2577.py" diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/1\354\260\250\354\233\220 \353\260\260\354\227\264/3052.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/4 array/3052.py" similarity index 100% rename from "sources/cometj03_\354\240\225\355\225\264\354\204\261/1\354\260\250\354\233\220 \353\260\260\354\227\264/3052.py" rename to "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/4 array/3052.py" diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/1\354\260\250\354\233\220 \353\260\260\354\227\264/4344.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/4 array/4344.py" similarity index 100% rename from "sources/cometj03_\354\240\225\355\225\264\354\204\261/1\354\260\250\354\233\220 \353\260\260\354\227\264/4344.py" rename to "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/4 array/4344.py" diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/\355\225\250\354\210\230/1065.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/5 function/1065.py" similarity index 100% rename from "sources/cometj03_\354\240\225\355\225\264\354\204\261/\355\225\250\354\210\230/1065.py" rename to "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/5 function/1065.py" diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/\355\225\250\354\210\230/15596.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/5 function/15596.py" similarity index 100% rename from "sources/cometj03_\354\240\225\355\225\264\354\204\261/\355\225\250\354\210\230/15596.py" rename to "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/5 function/15596.py" diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/\355\225\250\354\210\230/4673.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/5 function/4673.py" similarity index 100% rename from "sources/cometj03_\354\240\225\355\225\264\354\204\261/\355\225\250\354\210\230/4673.py" rename to "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/5 function/4673.py" diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/\353\254\270\354\236\220\354\227\264/10809.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/6 string/10809.py" similarity index 89% rename from "sources/cometj03_\354\240\225\355\225\264\354\204\261/\353\254\270\354\236\220\354\227\264/10809.py" rename to "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/6 string/10809.py" index 6e5f217..68539c2 100644 --- "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/\353\254\270\354\236\220\354\227\264/10809.py" +++ "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/6 string/10809.py" @@ -1,3 +1,4 @@ +# 10809 알파벳 찾기 S = input() alphabets = "abcdefghijklmnopqrstuvwxyz" indices = [-1] * 30 diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/6 string/1157.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/6 string/1157.py" new file mode 100644 index 0000000..c07e8a8 --- /dev/null +++ "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/6 string/1157.py" @@ -0,0 +1 @@ +# 1157 단어공부 diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/\353\254\270\354\236\220\354\227\264/2908.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/6 string/2908.py" similarity index 100% rename from "sources/cometj03_\354\240\225\355\225\264\354\204\261/\353\254\270\354\236\220\354\227\264/2908.py" rename to "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/6 string/2908.py" From 0bc86c9b31b6de0df7cbfd3ca9c79a46544f61e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A0=95=ED=95=B4=EC=84=B1?= Date: Thu, 7 Apr 2022 23:32:57 +0900 Subject: [PATCH 10/50] string 4 solved --- .../step/6 string/1157.py" | 17 ++++++++++++ .../step/6 string/1316.py" | 26 +++++++++++++++++++ .../step/6 string/2941.py" | 9 +++++++ .../step/6 string/5622.py" | 15 +++++++++++ 4 files changed, 67 insertions(+) create mode 100644 "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/6 string/1316.py" create mode 100644 "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/6 string/2941.py" create mode 100644 "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/6 string/5622.py" diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/6 string/1157.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/6 string/1157.py" index c07e8a8..52d2686 100644 --- "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/6 string/1157.py" +++ "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/6 string/1157.py" @@ -1 +1,18 @@ # 1157 단어공부 +counts = [0] * 30 +init = ord('A') + +S = input().upper() + +for x in S: + i = ord(x) - init + counts[i] += 1 + +index = counts.index(max(counts)) + +counts.sort(reverse=True) + +if counts[0] == counts[1]: + print('?') +else: + print(chr(init + index)) diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/6 string/1316.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/6 string/1316.py" new file mode 100644 index 0000000..79bac8d --- /dev/null +++ "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/6 string/1316.py" @@ -0,0 +1,26 @@ +# 1316 그룹 단어 체커 +flags = [0] * 30 + +N = int(input()) +count = 0 +init = ord('a') + +def check(s): + index = ord(s[0]) - init + flags[index] += 1 + + for i in range(1, len(s)): + index = ord(s[i]) - init + if flags[index] != 0 and s[i-1] != s[i]: + return False + flags[index] += 1 + return True + +while N > 0: + s = input() + flags = [0] * 30 + if check(s): + count += 1 + N -= 1 + +print(count) \ No newline at end of file diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/6 string/2941.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/6 string/2941.py" new file mode 100644 index 0000000..9f25149 --- /dev/null +++ "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/6 string/2941.py" @@ -0,0 +1,9 @@ +# 2941 크로아티아 알파벳 +alpha = ('c=', 'c-', 'dz=', 'd-', 'lj', 'nj', 's=', 'z=') + +S = input() + +for a in alpha: + S = S.replace(a, '.') + +print(len(S)) \ No newline at end of file diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/6 string/5622.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/6 string/5622.py" new file mode 100644 index 0000000..2e3b564 --- /dev/null +++ "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/6 string/5622.py" @@ -0,0 +1,15 @@ +# 5622 다이얼 +dial = ['ABC', 'DEF', 'GHI', 'JKL', 'MNO', 'PQRS', 'TUV', 'WXYZ'] + +s = input() + +time = 0 +for c in s: + i = 0 + while i < 8: + if c in dial[i]: + break + i += 1 + time += i + 3 + +print(time) \ No newline at end of file From 556c1191e78ce09ff966b440f2f3f692b7d528d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A0=95=ED=95=B4=EC=84=B1?= Date: Fri, 8 Apr 2022 23:22:15 +0900 Subject: [PATCH 11/50] Create 1333.py --- .../1333.py" | 15 +++++++++++++++ .../step/7 math1/1712.py" | 9 +++++++++ 2 files changed, 24 insertions(+) create mode 100644 "sources/cometj03_\354\240\225\355\225\264\354\204\261/1333.py" create mode 100644 "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/7 math1/1712.py" diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/1333.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/1333.py" new file mode 100644 index 0000000..6b42b0d --- /dev/null +++ "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/1333.py" @@ -0,0 +1,15 @@ +# 1333 부재중 전화 +N, L, D = map(int, input().split()) + +for i in range(1, N+1): + current = L*i + 5*(i-1) # 음악이 끝난 시점 + + if current % D == 0: + print(current) + break + elif (current+4) % D < 4: # 음악이 끝난 시점 + (1~4) + print((current // D + 1) * D) + break +else: + end = L*N + 5*(N-1) + print((end // D + 1) * D) diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/7 math1/1712.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/7 math1/1712.py" new file mode 100644 index 0000000..ff66aec --- /dev/null +++ "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/7 math1/1712.py" @@ -0,0 +1,9 @@ +# 1712 손익분기점 +A, B, C = map(int, input().split()) + +cost = C - B + +if cost > 0: + print(A // cost + 1) +else: + print(-1) \ No newline at end of file From 6365d66bdb5393a28d61b4f9037c6de1ab603ddb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A0=95=ED=95=B4=EC=84=B1?= Date: Sat, 9 Apr 2022 22:58:31 +0900 Subject: [PATCH 12/50] 1193, 2292 --- .../step/7 math1/1193.py" | 14 ++++++++++++++ .../step/7 math1/2292.py" | 15 +++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/7 math1/1193.py" create mode 100644 "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/7 math1/2292.py" diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/7 math1/1193.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/7 math1/1193.py" new file mode 100644 index 0000000..6fc6ad2 --- /dev/null +++ "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/7 math1/1193.py" @@ -0,0 +1,14 @@ +# 1193 분수찾기 +X = int(input()) + +n, s = 1, 1 +while not (s <= X < s + n): + s += n + n += 1 + +rest = X - (n * (n-1))//2 + +if n % 2 == 0: + print(f'{rest}/{n - rest + 1}') +else: + print(f'{n - rest + 1}/{rest}') \ No newline at end of file diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/7 math1/2292.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/7 math1/2292.py" new file mode 100644 index 0000000..7b804d7 --- /dev/null +++ "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/7 math1/2292.py" @@ -0,0 +1,15 @@ +# 2292 벌집 +N = int(input()) + +block = 1 +step = 1 +while block <= 2_000_000_000: + if N == 1: + print(1) + break + addBlock = step * 6 + if block < N <= block + addBlock: + print(step + 1) + break + block += addBlock + step += 1 \ No newline at end of file From f31bbc37ded9a1786c65bd2a770cf1715b90eaac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A0=95=ED=95=B4=EC=84=B1?= Date: Mon, 11 Apr 2022 23:14:11 +0900 Subject: [PATCH 13/50] Create 2869.py --- .../step/7 math1/10757.py" | 7 +++++++ .../step/7 math1/2869.py" | 9 +++++++++ 2 files changed, 16 insertions(+) create mode 100644 "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/7 math1/10757.py" create mode 100644 "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/7 math1/2869.py" diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/7 math1/10757.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/7 math1/10757.py" new file mode 100644 index 0000000..d429ac7 --- /dev/null +++ "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/7 math1/10757.py" @@ -0,0 +1,7 @@ +# 10757 큰 수 A+B +A, B = input().split() +a = list(map(int, A))[::-1] +b = list(map(int, B))[::-1] + +length = max(len(a), len(b)) +answer = [] diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/7 math1/2869.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/7 math1/2869.py" new file mode 100644 index 0000000..8adefa2 --- /dev/null +++ "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/7 math1/2869.py" @@ -0,0 +1,9 @@ +# 2869 달팽이는 올라가고 싶다 +A, B, V = map(int, input().split()) + +up = A - B + +if (V - A) % up == 0: + print((V - A) // up + 1) +else: + print((V - A) // up + 2) \ No newline at end of file From 48de559bed94a62a29a2e44f61cb7f1416eb5342 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A0=95=ED=95=B4=EC=84=B1?= Date: Tue, 12 Apr 2022 23:20:11 +0900 Subject: [PATCH 14/50] math 1 solved --- .../step/7 math1/10250.py" | 12 +++++++++ .../step/7 math1/2775.py" | 25 +++++++++++++++++++ .../step/7 math1/2839.py" | 16 ++++++++++++ 3 files changed, 53 insertions(+) create mode 100644 "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/7 math1/10250.py" create mode 100644 "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/7 math1/2775.py" create mode 100644 "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/7 math1/2839.py" diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/7 math1/10250.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/7 math1/10250.py" new file mode 100644 index 0000000..1c3142f --- /dev/null +++ "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/7 math1/10250.py" @@ -0,0 +1,12 @@ +# 10250 ACM 호텔 +T = int(input()) + +while T > 0: + T -= 1 + H, W, N = map(int, input().split()) + floor = N % H + dong = N // H + 1 + if N % H == 0: + floor = H + dong -= 1 + print(floor*100 + dong) \ No newline at end of file diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/7 math1/2775.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/7 math1/2775.py" new file mode 100644 index 0000000..b26d0f4 --- /dev/null +++ "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/7 math1/2775.py" @@ -0,0 +1,25 @@ +# 2775 부녀회장이 될테야 +''' +1 2 3 4 5 +1 3 6 10 15 +1 4 10 20 35 +1 5 ... +''' + +T = int(input()) + +arr = [[1] * 15] + +for i in range(1, 15): + arr[0][i] = i + arr.append([1] * 15) # 내부 리스트 복사 방지 + +for i in range(1, 15): + for j in range(2, 15): + arr[i][j] = arr[i][j-1] + arr[i-1][j] + +while T > 0: + T -= 1 + k = int(input()) + n = int(input()) + print(arr[k][n]) \ No newline at end of file diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/7 math1/2839.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/7 math1/2839.py" new file mode 100644 index 0000000..1d5f2f6 --- /dev/null +++ "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/7 math1/2839.py" @@ -0,0 +1,16 @@ +# 2839 설탕 배달 +N = int(input()) + +five_cnt = N // 5 + +while True: + rest = N - five_cnt*5 + if rest % 3 == 0: + print(five_cnt + rest//3) + break + + if five_cnt > 0: + five_cnt -= 1 + continue + print(-1) + break \ No newline at end of file From a7c9140fb431b3b9e340e484c4b6f7e7c65f24e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A0=95=ED=95=B4=EC=84=B1?= Date: Wed, 13 Apr 2022 23:27:37 +0900 Subject: [PATCH 15/50] solve 10757 --- .../step/7 math1/10757.py" | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/7 math1/10757.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/7 math1/10757.py" index d429ac7..197dbc4 100644 --- "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/7 math1/10757.py" +++ "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/7 math1/10757.py" @@ -3,5 +3,24 @@ a = list(map(int, A))[::-1] b = list(map(int, B))[::-1] -length = max(len(a), len(b)) + +if len(a) < len(b): + a, b = b, a + answer = [] +length = len(b) # 길이 중 최소 + +for i in range(length): + answer.append(a[i] + b[i]) +answer += a[length:] + [0] + +for i in range(len(answer) - 1): + if answer[i] >= 10: + answer[i+1] += 1 + answer[i] %= 10 + +if answer[-1] == 0: + del answer[-1] + +for n in answer[::-1]: + print(n, end='') From 3761223b7c54c633e51d9f11871a3e49816367a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A0=95=ED=95=B4=EC=84=B1?= Date: Thu, 14 Apr 2022 00:05:05 +0900 Subject: [PATCH 16/50] Create 11653.py --- .../step/8 math2/11653.py" | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/8 math2/11653.py" diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/8 math2/11653.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/8 math2/11653.py" new file mode 100644 index 0000000..e16d07e --- /dev/null +++ "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/8 math2/11653.py" @@ -0,0 +1,8 @@ +# 11653 소인수분해 +N = int(input()) + +for i in range(2, N+1): + if N % i == 0: + while N % i == 0: + print(i) + N //= i From 11df3b7efe4b9db937231f010b72b2d5526ad415 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A0=95=ED=95=B4=EC=84=B1?= Date: Thu, 14 Apr 2022 23:55:26 +0900 Subject: [PATCH 17/50] Create 4948.py, 9020.py --- .../step/8 math2/4948.py" | 14 ++++++++++++++ .../step/8 math2/9020.py" | 17 +++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/8 math2/4948.py" create mode 100644 "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/8 math2/9020.py" diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/8 math2/4948.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/8 math2/4948.py" new file mode 100644 index 0000000..5afaf3a --- /dev/null +++ "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/8 math2/4948.py" @@ -0,0 +1,14 @@ +# 4948 베르트랑 공준 +while True: + n = int(input()) + + if n == 0: break + + count = 0 + for i in range(n + 1, 2*n + 1): + for j in range(2, int(i**0.5) + 1): + if i % j == 0: + break + else: + count += 1 + print(count) \ No newline at end of file diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/8 math2/9020.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/8 math2/9020.py" new file mode 100644 index 0000000..d97c78c --- /dev/null +++ "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/8 math2/9020.py" @@ -0,0 +1,17 @@ +# 9020 골드바흐의 추측 +def is_prime(n): + for i in range(2, int(n**0.5) + 1): + if n % i == 0: + return False + return True + +T = int(input()) +while T > 0: + T -= 1 + n = int(input()) + h = n//2 + + for i in range(h): + if is_prime(h - i) and is_prime(h + i): + print(h - i, h + i) + break From 71aae6ae217284d9a569a3486f585d23e2e05514 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A0=95=ED=95=B4=EC=84=B1?= Date: Sun, 17 Apr 2022 15:27:06 +0900 Subject: [PATCH 18/50] math2 complete --- .../step/8 math2/1002.py" | 17 +++++++++++++++++ .../step/8 math2/1085.py" | 4 ++++ .../step/8 math2/3009.py" | 16 ++++++++++++++++ .../step/8 math2/4153.py" | 10 ++++++++++ 4 files changed, 47 insertions(+) create mode 100644 "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/8 math2/1002.py" create mode 100644 "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/8 math2/1085.py" create mode 100644 "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/8 math2/3009.py" create mode 100644 "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/8 math2/4153.py" diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/8 math2/1002.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/8 math2/1002.py" new file mode 100644 index 0000000..82b2f86 --- /dev/null +++ "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/8 math2/1002.py" @@ -0,0 +1,17 @@ +# 1002 터렛 +T = int(input()) +while T > 0: + T -= 1 + x1, y1, r1, x2, y2, r2 = map(int, input().split()) + d = ((x1-x2)**2 + (y1-y2)**2)**0.5 + + if d == 0: + print(-1 if r1 == r2 else 0) + continue + + if abs(r1 - r2) < d < r1 + r2: + print(2) + elif abs(r1 - r2) == d or d == r1 + r2: + print(1) + else: + print(0) \ No newline at end of file diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/8 math2/1085.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/8 math2/1085.py" new file mode 100644 index 0000000..496b129 --- /dev/null +++ "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/8 math2/1085.py" @@ -0,0 +1,4 @@ +# 1085 직사각형에서 탈출 +x, y, w, h = map(int, input().split()) + +print(min(min(x, w-x), min(y, h-y))) \ No newline at end of file diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/8 math2/3009.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/8 math2/3009.py" new file mode 100644 index 0000000..a29cff4 --- /dev/null +++ "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/8 math2/3009.py" @@ -0,0 +1,16 @@ +# 3009 네 번째 점 +x_points = [] +y_points = [] + +for _ in range(3): + x, y = map(int, input().split()) + x_points.append(x) + y_points.append(y) + +for i in range(3): + if x_points.count(x_points[i]) == 1: + x = x_points[i] + if y_points.count(y_points[i]) == 1: + y = y_points[i] + +print(x, y) diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/8 math2/4153.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/8 math2/4153.py" new file mode 100644 index 0000000..3bc316b --- /dev/null +++ "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/8 math2/4153.py" @@ -0,0 +1,10 @@ +# 4153 직각삼각형 +while True: + arr = list(map(int, input().split())) + if arr.count(0) == 3: + break + arr.sort() + if arr[2]**2 == arr[1]**2 + arr[0]**2: + print('right') + else: + print('wrong') \ No newline at end of file From 79aa5395766dfceebdfecbd53f0c1e1e907727e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A0=95=ED=95=B4=EC=84=B1?= Date: Mon, 18 Apr 2022 23:24:48 +0900 Subject: [PATCH 19/50] 9 recursive --- .../step/9 recursive/10872.py" | 6 ++++++ .../step/9 recursive/11729.py" | 21 +++++++++++++++++++ .../step/9 recursive/2447.py" | 2 ++ 3 files changed, 29 insertions(+) create mode 100644 "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/9 recursive/10872.py" create mode 100644 "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/9 recursive/11729.py" create mode 100644 "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/9 recursive/2447.py" diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/9 recursive/10872.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/9 recursive/10872.py" new file mode 100644 index 0000000..8bd1c8b --- /dev/null +++ "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/9 recursive/10872.py" @@ -0,0 +1,6 @@ +# 10872 팩토리얼 +def factorial(n): + return n * factorial(n-1) if n > 1 else 1 + +N = int(input()) +print(factorial(N)) \ No newline at end of file diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/9 recursive/11729.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/9 recursive/11729.py" new file mode 100644 index 0000000..cf9076a --- /dev/null +++ "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/9 recursive/11729.py" @@ -0,0 +1,21 @@ +# 11729 하노이 탑 이동 순서 +steps = [] +def hanoi(n, pos, target): + if n == 1: + steps.append(f'{pos} {target}') + return + + # new_target = pos와 target이 아닌 곳 + new_target = 1+2+3 - pos - target + + hanoi(n-1, pos, new_target) + steps.append(f'{pos} {target}') + hanoi(n-1, new_target, target) + + +N = int(input()) +hanoi(N, 1, 3) + +print(len(steps)) +for s in steps: + print(s) \ No newline at end of file diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/9 recursive/2447.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/9 recursive/2447.py" new file mode 100644 index 0000000..cb99a03 --- /dev/null +++ "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/9 recursive/2447.py" @@ -0,0 +1,2 @@ +# 2447 별 찍기 - 10 + From 0ab6ff39aa07d86fb3e3960b9b24facc9bb5e355 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A0=95=ED=95=B4=EC=84=B1?= Date: Tue, 19 Apr 2022 20:38:26 +0900 Subject: [PATCH 20/50] 0419 --- .../step/10 brute-force/2231.py" | 16 ++++++++++++++++ .../step/10 brute-force/2798.py" | 17 +++++++++++++++++ .../step/9 recursive/2447.py" | 19 +++++++++++++++++++ 3 files changed, 52 insertions(+) create mode 100644 "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/10 brute-force/2231.py" create mode 100644 "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/10 brute-force/2798.py" diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/10 brute-force/2231.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/10 brute-force/2231.py" new file mode 100644 index 0000000..d52b1f5 --- /dev/null +++ "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/10 brute-force/2231.py" @@ -0,0 +1,16 @@ +# 2231 분해합 +N = int(input()) + +def sum_digit(n): + if n < 10: + return n + return n%10 + sum_digit(n//10) + +t = int(len(str(N))) * 9 + +for x in range(N-t, N): + if N == sum_digit(x) + x: + print(x) + break +else: + print(0) \ No newline at end of file diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/10 brute-force/2798.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/10 brute-force/2798.py" new file mode 100644 index 0000000..329a7b2 --- /dev/null +++ "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/10 brute-force/2798.py" @@ -0,0 +1,17 @@ +# 2798 블랙잭 +from itertools import combinations + +N, M = map(int, input().split()) +items = list(map(int, input().split())) + +item_combi = combinations(items, 3) +item_combi_sum = list(map(sum, item_combi)) + +item_combi_sum.sort() + +ans = 0 +for i in item_combi_sum: + if i > M: + break + ans = i +print(ans) \ No newline at end of file diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/9 recursive/2447.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/9 recursive/2447.py" index cb99a03..79556d5 100644 --- "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/9 recursive/2447.py" +++ "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/9 recursive/2447.py" @@ -1,2 +1,21 @@ # 2447 별 찍기 - 10 +N = int(input()) +arr = [[' ']*N for _ in range(N)] +def star(x, y, n): + if n == 1: + arr[x][y] = '*' + return + for i in range(3): + for j in range(3): + if i == j == 1: + continue + t = n//3 + star(x + t*j, y + t*i, t) + + +star(0, 0, N) +for row in arr: + for e in row: + print(e, end='') + print() \ No newline at end of file From 21f80cb69cc7e1aaf441496ecca6e339916924a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A0=95=ED=95=B4=EC=84=B1?= Date: Wed, 20 Apr 2022 23:58:43 +0900 Subject: [PATCH 21/50] 1436 --- .../step/10 brute-force/1436.py" | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/10 brute-force/1436.py" diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/10 brute-force/1436.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/10 brute-force/1436.py" new file mode 100644 index 0000000..e0e89c4 --- /dev/null +++ "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/10 brute-force/1436.py" @@ -0,0 +1,12 @@ +# 1436 영화감독 숍 +def six(n): + if n <= 6: + return (n-1)*1000 + 666 + if n <= 15: + return 6660 + n - 6 + if n <= 18: + return (n-9)*1000 + 666 + return str(n//18) + ',' + str(six(n%19)) + +N = int(input()) +print(six(N)) \ No newline at end of file From c7f1d3f7a333dd83221c1b76175497560dd24b1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A0=95=ED=95=B4=EC=84=B1?= Date: Thu, 21 Apr 2022 22:59:18 +0900 Subject: [PATCH 22/50] 1436, 1018 --- .../step/10 brute-force/1018.py" | 27 +++++++++++++++++++ .../step/10 brute-force/1436.py" | 17 +++++------- 2 files changed, 34 insertions(+), 10 deletions(-) create mode 100644 "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/10 brute-force/1018.py" diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/10 brute-force/1018.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/10 brute-force/1018.py" new file mode 100644 index 0000000..8fa29e2 --- /dev/null +++ "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/10 brute-force/1018.py" @@ -0,0 +1,27 @@ +# 1018 체스판 다시 칠하기 +N, M = map(int, input().split()) +arr = [input() for _ in range(N)] +mins = [] + +samples = [ + ['WBWBWBWB', 'BWBWBWBW'] * 4, + ['BWBWBWBW', 'WBWBWBWB'] * 4 +] + +def check(arr88): + return min(map(lambda s: diff(arr88, s), samples)) # 두 샘플 중 차이점이 작은 것 + +def diff(arr88, sample): + d = 0 + for i in range(8): + for j in range(8): + if sample[i][j] != arr88[i][j]: + d += 1 + return d + +for y in range(N-8+1): + for x in range(M-8+1): + sliced = [arr[i][x:x+8] for i in range(y, y+8)] + mins.append(check(sliced)) + +print(min(mins)) diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/10 brute-force/1436.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/10 brute-force/1436.py" index e0e89c4..57b633b 100644 --- "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/10 brute-force/1436.py" +++ "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/10 brute-force/1436.py" @@ -1,12 +1,9 @@ # 1436 영화감독 숍 -def six(n): - if n <= 6: - return (n-1)*1000 + 666 - if n <= 15: - return 6660 + n - 6 - if n <= 18: - return (n-9)*1000 + 666 - return str(n//18) + ',' + str(six(n%19)) - N = int(input()) -print(six(N)) \ No newline at end of file +n = 666 +count = 0 +while count < N: + if '666' in str(n): + count += 1 + n += 1 +print(n-1) \ No newline at end of file From bb28258417997377ad04325774e88ed59fef8cc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A0=95=ED=95=B4=EC=84=B1?= Date: Sat, 23 Apr 2022 18:30:01 +0900 Subject: [PATCH 23/50] sort --- .../step/11 sort/1427.py" | 5 +++++ .../step/11 sort/2108.py" | 16 ++++++++++++++++ .../step/11 sort/2751.py" | 6 ++++++ 3 files changed, 27 insertions(+) create mode 100644 "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/11 sort/1427.py" create mode 100644 "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/11 sort/2108.py" create mode 100644 "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/11 sort/2751.py" diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/11 sort/1427.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/11 sort/1427.py" new file mode 100644 index 0000000..7d9cc3d --- /dev/null +++ "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/11 sort/1427.py" @@ -0,0 +1,5 @@ +# 1427 소트인사이드 +arr = list(map(int, input())) +arr.sort() +for n in arr[::-1]: + print(n, end='') \ No newline at end of file diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/11 sort/2108.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/11 sort/2108.py" new file mode 100644 index 0000000..7d76097 --- /dev/null +++ "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/11 sort/2108.py" @@ -0,0 +1,16 @@ +# 2108 통계학 +from collections import Counter + +N = int(input()) +arr = [int(input()) for _ in range(N)] +arr.sort() + +count = Counter(arr).most_common() + +print(round(sum(arr) / len(arr))) +print(arr[(N-1)//2]) +if len(count) > 1 and count[0][1] == count[1][1]: + print(count[1][0]) +else: + print(count[0][0]) +print(arr[-1] - arr[0]) \ No newline at end of file diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/11 sort/2751.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/11 sort/2751.py" new file mode 100644 index 0000000..8636070 --- /dev/null +++ "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/11 sort/2751.py" @@ -0,0 +1,6 @@ +# 2751 수 정렬하기 2 +N = int(input()) +arr = [int(input()) for _ in range(N)] +arr.sort() +for n in arr: + print(n) \ No newline at end of file From 9aa92bda76f0369aefbaa926d052894c5f25767c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A0=95=ED=95=B4=EC=84=B1?= Date: Sun, 24 Apr 2022 14:23:00 +0900 Subject: [PATCH 24/50] 0424 --- .../step/11 sort/11650.py" | 8 ++++++++ .../step/11 sort/11651.py" | 8 ++++++++ 2 files changed, 16 insertions(+) create mode 100644 "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/11 sort/11650.py" create mode 100644 "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/11 sort/11651.py" diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/11 sort/11650.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/11 sort/11650.py" new file mode 100644 index 0000000..ef9b0d2 --- /dev/null +++ "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/11 sort/11650.py" @@ -0,0 +1,8 @@ +# 11650 좌표 정렬하기 +N = int(input()) +points = [tuple(map(int, input().split())) for _ in range(N)] +points.sort(key=lambda x: x[1]) +points.sort(key=lambda x: x[0]) + +for p in points: + print(p[0], p[1]) \ No newline at end of file diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/11 sort/11651.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/11 sort/11651.py" new file mode 100644 index 0000000..016a935 --- /dev/null +++ "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/11 sort/11651.py" @@ -0,0 +1,8 @@ +# 11651 좌표 정렬하기 2 +N = int(input()) +points = [tuple(map(int, input().split())) for _ in range(N)] +points.sort(key=lambda x: x[0]) +points.sort(key=lambda x: x[1]) + +for p in points: + print(p[0], p[1]) \ No newline at end of file From 73e16362ca81f84869c9cfb2bd42ee77b52a2ecb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A0=95=ED=95=B4=EC=84=B1?= Date: Mon, 25 Apr 2022 21:29:42 +0900 Subject: [PATCH 25/50] 1181, 10814 --- .../step/11 sort/10814.py" | 7 +++++++ .../step/11 sort/1181.py" | 8 ++++++++ 2 files changed, 15 insertions(+) create mode 100644 "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/11 sort/10814.py" create mode 100644 "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/11 sort/1181.py" diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/11 sort/10814.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/11 sort/10814.py" new file mode 100644 index 0000000..a806d86 --- /dev/null +++ "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/11 sort/10814.py" @@ -0,0 +1,7 @@ +# 10814 나이순 정렬 +N = int(input()) +arr = [input().split() for _ in range(N)] +arr.sort(key=lambda x: int(x[0])) + +for a in arr: + print(a[0], a[1]) \ No newline at end of file diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/11 sort/1181.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/11 sort/1181.py" new file mode 100644 index 0000000..80345a5 --- /dev/null +++ "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/11 sort/1181.py" @@ -0,0 +1,8 @@ +# 1181 단어 정렬 +N = int(input()) +words = list(set([input() for _ in range(N)])) +words.sort() +words.sort(key=len) + +for w in words: + print(w) From 2b7a19ff594e3df791bdf70befe2bd1d3b3f6646 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A0=95=ED=95=B4=EC=84=B1?= Date: Tue, 26 Apr 2022 23:36:28 +0900 Subject: [PATCH 26/50] 18870 --- .../step/11 sort/18870.py" | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/11 sort/18870.py" diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/11 sort/18870.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/11 sort/18870.py" new file mode 100644 index 0000000..b43f5ed --- /dev/null +++ "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/11 sort/18870.py" @@ -0,0 +1,14 @@ +# 18870 좌표 압축 +N = int(input()) +rawArr = list(map(int, input().split())) + +s = sorted(list(set(rawArr))) +L = len(s) + +dic = dict() +for i in range(L): + key = str(s[i]) + dic[key] = i + +for n in rawArr: + print(dic[str(n)], end=' ') \ No newline at end of file From 79f6fe2929e82260820b8a6afc77931b6ed5dcf8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A0=95=ED=95=B4=EC=84=B1?= Date: Wed, 27 Apr 2022 22:47:18 +0900 Subject: [PATCH 27/50] 5086 --- .../step/12 number_set/5086.py" | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/12 number_set/5086.py" diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/12 number_set/5086.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/12 number_set/5086.py" new file mode 100644 index 0000000..d30b82e --- /dev/null +++ "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/12 number_set/5086.py" @@ -0,0 +1,10 @@ +while True: + a, b = map(int, input().split()) + if a == b == 0: + break + if a % b == 0: + print("multiple") + elif b % a == 0: + print("factor") + else: + print("neither") \ No newline at end of file From 46b60c68a5087fb29916f850eb573907ac47cd25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A0=95=ED=95=B4=EC=84=B1?= Date: Thu, 28 Apr 2022 15:00:27 +0900 Subject: [PATCH 28/50] 1934 --- .../step/12 number_set/1934.py" | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/12 number_set/1934.py" diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/12 number_set/1934.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/12 number_set/1934.py" new file mode 100644 index 0000000..e1b6ede --- /dev/null +++ "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/12 number_set/1934.py" @@ -0,0 +1,9 @@ +T = int(input()) + +def gcd(a, b): + return a if b == 0 else gcd(b, a % b) + +while T > 0: + T -= 1 + a, b = map(int, input().split()) + print(a * b // gcd(a, b)) From b1209b343b41eb43c722c18f7013b4e95b798aa5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A0=95=ED=95=B4=EC=84=B1?= Date: Fri, 29 Apr 2022 23:42:50 +0900 Subject: [PATCH 29/50] number_set --- .../step/12 number_set/11051.py" | 12 ++++++++++++ .../step/12 number_set/1676.py" | 14 ++++++++++++++ .../step/12 number_set/3036.py" | 10 ++++++++++ 3 files changed, 36 insertions(+) create mode 100644 "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/12 number_set/11051.py" create mode 100644 "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/12 number_set/1676.py" create mode 100644 "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/12 number_set/3036.py" diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/12 number_set/11051.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/12 number_set/11051.py" new file mode 100644 index 0000000..a48526a --- /dev/null +++ "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/12 number_set/11051.py" @@ -0,0 +1,12 @@ +def fact(n, end): + result = 1 + while n > end: + result *= n + n -= 1 + return result + +def nCr(n, r): + return fact(n, r) // fact(n - r, 1) + +n, r = map(int, input().split()) +print(nCr(n, r) % 10007) \ No newline at end of file diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/12 number_set/1676.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/12 number_set/1676.py" new file mode 100644 index 0000000..fce2472 --- /dev/null +++ "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/12 number_set/1676.py" @@ -0,0 +1,14 @@ +N = int(input()) +cnt2 = 0 +cnt5 = 0 + +while N > 0: + n = N + while n % 2 == 0: + cnt2 += 1 + n //= 2 + while n % 5 == 0: + cnt5 += 1 + n //= 5 + N -= 1 +print(min(cnt2, cnt5)) \ No newline at end of file diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/12 number_set/3036.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/12 number_set/3036.py" new file mode 100644 index 0000000..6216318 --- /dev/null +++ "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/12 number_set/3036.py" @@ -0,0 +1,10 @@ +N = int(input()) +rings = list(map(int, input().split())) + +def gcd(a, b): + return a if b == 0 else gcd(b, a%b) + +for i in range(1, N): + a, b = rings[0], rings[i] + g = gcd(a, b) + print(f"{a//g}/{b//g}") \ No newline at end of file From aab9f66b197dac3ba23392de640f5b6778fe979a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A0=95=ED=95=B4=EC=84=B1?= Date: Sat, 30 Apr 2022 23:14:50 +0900 Subject: [PATCH 30/50] 1010, 9375 --- .../step/12 number_set/1010.py" | 15 +++++++++++++++ .../step/12 number_set/9375.py" | 18 ++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/12 number_set/1010.py" create mode 100644 "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/12 number_set/9375.py" diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/12 number_set/1010.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/12 number_set/1010.py" new file mode 100644 index 0000000..74d452c --- /dev/null +++ "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/12 number_set/1010.py" @@ -0,0 +1,15 @@ +def fact(n, end): + result = 1 + while n > end: + result *= n + n -= 1 + return result + +def nCr(n, r): + return fact(n, r) // fact(n - r, 1) + +T = int(input()) +while T > 0: + T -= 1 + N, M = map(int, input().split()) + print(nCr(M, N)) \ No newline at end of file diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/12 number_set/9375.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/12 number_set/9375.py" new file mode 100644 index 0000000..389c54e --- /dev/null +++ "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/12 number_set/9375.py" @@ -0,0 +1,18 @@ +from collections import Counter + +T = int(input()) +while T > 0: + T -= 1 + + kinds = [] + n = int(input()) + while n > 0: + n -= 1 + name, kind = input().split() + kinds.append(kind) + + result = Counter(kinds) + ans = 1 + for k in result: + ans *= result[k] + 1 + print(ans-1) \ No newline at end of file From c6131fb9ae0ab8c75bc4cd9338d966a4bfa3dd1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A0=95=ED=95=B4=EC=84=B1?= Date: Mon, 2 May 2022 23:44:17 +0900 Subject: [PATCH 31/50] 2004 --- .../step/12 number_set/2004.py" | 21 +++++++++++++++++++ .../step/12 number_set/9375.py" | 4 ++-- 2 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/12 number_set/2004.py" diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/12 number_set/2004.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/12 number_set/2004.py" new file mode 100644 index 0000000..c8b04c1 --- /dev/null +++ "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/12 number_set/2004.py" @@ -0,0 +1,21 @@ +n, m = map(int, input().split()) +m = min(m, n-m) + +def count_two(n): + two = 0 + while n: + n //= 2 + two += n + return two + +def count_five(n): + five = 0 + while n: + n //= 5 + five += n + return five + +# nCm = n!/(m!(n-m)!) +two_cnt = count_two(n) - count_two(m) - count_two(n-m) +five_cnt = count_five(n) - count_five(m) - count_five(n-m) +print(min(two_cnt, five_cnt)) \ No newline at end of file diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/12 number_set/9375.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/12 number_set/9375.py" index 389c54e..af3fe9f 100644 --- "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/12 number_set/9375.py" +++ "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/12 number_set/9375.py" @@ -14,5 +14,5 @@ result = Counter(kinds) ans = 1 for k in result: - ans *= result[k] + 1 - print(ans-1) \ No newline at end of file + ans *= result[k] + 1 # 안 입는 경우와 입는 경우 모두 포함해서 곱함 + print(ans-1) # 모든 옷을 안 입는 경우만 제외 \ No newline at end of file From e1b365d4f521d5b9303eccfb180f0e48d8cdf6fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A0=95=ED=95=B4=EC=84=B1?= Date: Tue, 3 May 2022 23:03:37 +0900 Subject: [PATCH 32/50] 15649, 15650 --- .../step/13 backtracking/15649.py" | 14 ++++++++++++++ .../step/13 backtracking/15650.py" | 14 ++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/13 backtracking/15649.py" create mode 100644 "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/13 backtracking/15650.py" diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/13 backtracking/15649.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/13 backtracking/15649.py" new file mode 100644 index 0000000..24f4bc5 --- /dev/null +++ "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/13 backtracking/15649.py" @@ -0,0 +1,14 @@ +N, M = map(int, input().split()) + +def track(visit, count): + if count == 1: + for v in visit: + print(v, end=' ') + print() + return + for i in range(1, N+1): + if i in visit: continue + track(visit + [i], count-1) + +for i in range(1, N+1): + track([i], M) \ No newline at end of file diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/13 backtracking/15650.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/13 backtracking/15650.py" new file mode 100644 index 0000000..86bd844 --- /dev/null +++ "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/13 backtracking/15650.py" @@ -0,0 +1,14 @@ +N, M = map(int, input().split()) +s = [] + +def dfs(start): + if len(s) == M: + print(' '.join(map(str, s))) + return + for i in range(start, N+1): + if i not in s: + s.append(i) + dfs(i+1) + s.pop() + +dfs(1) \ No newline at end of file From 4873cb33767dc1532b57d4a43433449ed86d9c36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A0=95=ED=95=B4=EC=84=B1?= Date: Wed, 4 May 2022 23:09:57 +0900 Subject: [PATCH 33/50] 2981 --- .../step/12 number_set/2981.py" | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/12 number_set/2981.py" diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/12 number_set/2981.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/12 number_set/2981.py" new file mode 100644 index 0000000..52f46c1 --- /dev/null +++ "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/12 number_set/2981.py" @@ -0,0 +1,27 @@ +''' +각 수의 형태는 a*q + r를 띄고 있을 때, +그 중 최솟값 m = p*q + r을 각각 빼주면 +리스트의 원소들은 (a-p)*q 형태를 띠게 됨. +각 원소의 최대 공약수는 q임. +''' +import sys +input = sys.stdin.readline + +def gcd(a, b): + return a if b == 0 else gcd(b, a%b) + +N = int(input()) +arr = [int(input()) for _ in range(N)] + +m = min(arr) +arr_m = list(map(lambda x: x - m, arr)) + +gcd_list = [] +for i in range(N-1): + gcd_list.append(gcd(arr_m[i], arr_m[i+1])) + +gcd_m = min(gcd_list) +# gcd 중 최솟값(최대 공약수)의 약수 +for i in range(2, gcd_m+1): + if gcd_m % i == 0: + print(i, end=' ') \ No newline at end of file From 8006c2e9363ec3b727856d9fb24bbb93200786dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A0=95=ED=95=B4=EC=84=B1?= Date: Wed, 4 May 2022 23:29:31 +0900 Subject: [PATCH 34/50] =?UTF-8?q?=EC=B5=9C=EB=8C=80=20=EA=B3=B5=EC=95=BD?= =?UTF-8?q?=EC=88=98=20=EA=B5=AC=ED=95=98=EB=8A=94=20=EC=95=8C=EA=B3=A0?= =?UTF-8?q?=EB=A6=AC=EC=A6=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../step/12 number_set/2981.py" | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/12 number_set/2981.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/12 number_set/2981.py" index 52f46c1..a8854fe 100644 --- "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/12 number_set/2981.py" +++ "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/12 number_set/2981.py" @@ -21,7 +21,12 @@ def gcd(a, b): gcd_list.append(gcd(arr_m[i], arr_m[i+1])) gcd_m = min(gcd_list) +ans = [] # gcd 중 최솟값(최대 공약수)의 약수 -for i in range(2, gcd_m+1): +for i in range(2, int(gcd_m**0.5)+1): if gcd_m % i == 0: - print(i, end=' ') \ No newline at end of file + ans.append(i) + ans.append(gcd_m//i) +ans.append(gcd_m) +ans = sorted(list(set(ans))) +print(' '.join(map(str, ans))) \ No newline at end of file From c539e5c7dc716c34d75891ff971e3ca3b7ede49d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A0=95=ED=95=B4=EC=84=B1?= Date: Thu, 5 May 2022 11:28:25 +0900 Subject: [PATCH 35/50] 25083 --- .../step/1/25083.py" | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/1/25083.py" diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/1/25083.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/1/25083.py" new file mode 100644 index 0000000..50499e7 --- /dev/null +++ "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/1/25083.py" @@ -0,0 +1,6 @@ +print(''' ,r'"7 +r`-_ ,' ,/ + \. ". L_r' + `~\/ + | + |''') \ No newline at end of file From 417fa8dfc218268d56d1da956897eada3d063199 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A0=95=ED=95=B4=EC=84=B1?= Date: Thu, 5 May 2022 13:14:08 +0900 Subject: [PATCH 36/50] 17478 --- .../step/9 recursive/17478.py" | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/9 recursive/17478.py" diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/9 recursive/17478.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/9 recursive/17478.py" new file mode 100644 index 0000000..63c335c --- /dev/null +++ "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/9 recursive/17478.py" @@ -0,0 +1,17 @@ +N = int(input()) + +def f(n): + indent = '____' * (N - n) + print(indent + '"재귀함수가 뭔가요?"') + if n == 0: + print(indent + '"재귀함수는 자기 자신을 호출하는 함수라네"') + print(indent + '라고 답변하였지.') + return + print(indent + '"잘 들어보게. 옛날옛날 한 산 꼭대기에 이세상 모든 지식을 통달한 선인이 있었어.') + print(indent + '마을 사람들은 모두 그 선인에게 수많은 질문을 했고, 모두 지혜롭게 대답해 주었지.') + print(indent + '그의 답은 대부분 옳았다고 하네. 그런데 어느 날, 그 선인에게 한 선비가 찾아와서 물었어."') + f(n-1) + print(indent + '라고 답변하였지.') + +print("어느 한 컴퓨터공학과 학생이 유명한 교수님을 찾아가 물었다.") +f(N) \ No newline at end of file From 707d1f2df8bb8d2db73ac4c935c72f76eddc1840 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A0=95=ED=95=B4=EC=84=B1?= Date: Sat, 7 May 2022 09:31:12 +0900 Subject: [PATCH 37/50] 15651 --- .../step/13 backtracking/15651.py" | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/13 backtracking/15651.py" diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/13 backtracking/15651.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/13 backtracking/15651.py" new file mode 100644 index 0000000..5f45469 --- /dev/null +++ "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/13 backtracking/15651.py" @@ -0,0 +1,11 @@ +N, M = map(int, input().split()) +s = [] +def f(): + if len(s) == M: + print(*s) + return + for i in range(1, N+1): + s.append(i) + f() + s.pop() +f() \ No newline at end of file From 4503fee595487da9fde9d2bc32b6c4e38c0bdb00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A0=95=ED=95=B4=EC=84=B1?= Date: Sat, 7 May 2022 22:44:02 +0900 Subject: [PATCH 38/50] 15652 --- .../step/13 backtracking/15652.py" | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/13 backtracking/15652.py" diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/13 backtracking/15652.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/13 backtracking/15652.py" new file mode 100644 index 0000000..031835a --- /dev/null +++ "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/13 backtracking/15652.py" @@ -0,0 +1,11 @@ +N, M = map(int, input().split()) +s = [] +def f(start): + if len(s) == M: + print(*s) + return + for i in range(start, N+1): + s.append(i) + f(i) + s.pop() +f(1) \ No newline at end of file From e1912def925820d99d0a0b57bf84721058eed641 Mon Sep 17 00:00:00 2001 From: Jaehyun Kim Date: Tue, 10 May 2022 21:11:48 +0900 Subject: [PATCH 39/50] Create 4388.c --- .../4388.c" | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 "sources/rlapo213_\352\271\200\354\236\254\355\230\204/4388.c" diff --git "a/sources/rlapo213_\352\271\200\354\236\254\355\230\204/4388.c" "b/sources/rlapo213_\352\271\200\354\236\254\355\230\204/4388.c" new file mode 100644 index 0000000..44853c0 --- /dev/null +++ "b/sources/rlapo213_\352\271\200\354\236\254\355\230\204/4388.c" @@ -0,0 +1,29 @@ +#include + +int main() { + long long int a, b; + int u; + while (1) { + scanf("%lld %lld", &a, &b); + if (a == 0 && !b) + break; + int carry = 0; + u = 0; + while (1) { + int k1 = a % 10; + int k2 = b % 10; + a /= 10; + b /= 10; + + if (k1 + k2 + u > 9) { + carry++; + u = 1; + } + else + u = 0; + if (!a && !b) + break; + } + printf("%d\n", carry); + } +} \ No newline at end of file From 54d08dc738d47fa1adb02bd7337b2d09a2fe6ef5 Mon Sep 17 00:00:00 2001 From: Jaehyun Kim Date: Wed, 11 May 2022 15:09:38 +0900 Subject: [PATCH 40/50] Create 10174.c --- .../10174.c" | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 "sources/rlapo213_\352\271\200\354\236\254\355\230\204/10174.c" diff --git "a/sources/rlapo213_\352\271\200\354\236\254\355\230\204/10174.c" "b/sources/rlapo213_\352\271\200\354\236\254\355\230\204/10174.c" new file mode 100644 index 0000000..f2a6b56 --- /dev/null +++ "b/sources/rlapo213_\352\271\200\354\236\254\355\230\204/10174.c" @@ -0,0 +1,33 @@ +#include +int main() { + int n; + scanf("%d", &n); + while (n--) { + getchar(); + + char a[10000]; + scanf("%[^\n]s", a); + int len = 0; + while (a[len] != '\0') + len++; + for (int i = 0; i < len; i++) { + if (a[i] >= 'a' && a[i] <= 'z') + a[i] -= 32; + } + int flag = 0; + for (int i = 0; i < len/2; i++) { + if (a[i] != a[len-1 - i]) { + flag = 1; + break; + } + } + if (!flag) + printf("Yes\n"); + else + printf("No\n"); + } + + + + return 0; +} \ No newline at end of file From 47cf7425970870a48f178acad5f56d53562cb72f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A0=95=ED=95=B4=EC=84=B1?= Date: Fri, 13 May 2022 22:40:41 +0900 Subject: [PATCH 41/50] 14888 --- .../step/13 backtracking/14888.py" | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/13 backtracking/14888.py" diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/13 backtracking/14888.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/13 backtracking/14888.py" new file mode 100644 index 0000000..d07e5b9 --- /dev/null +++ "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/13 backtracking/14888.py" @@ -0,0 +1,29 @@ +N = int(input()) +num = list(map(int, input().split())) +op = list(map(int, input().split())) # + - * // +results = [] + +def dfs(depth, val): + if depth == N: + results.append(val) + return + if op[0]: + op[0] -= 1 + dfs(depth+1, val + num[depth]) + op[0] += 1 + if op[1]: + op[1] -= 1 + dfs(depth+1, val - num[depth]) + op[1] += 1 + if op[2]: + op[2] -= 1 + dfs(depth+1, val * num[depth]) + op[2] += 1 + if op[3]: + op[3] -= 1 + dfs(depth+1, int(val / num[depth])) + op[3] += 1 + +dfs(1, num[0]) +print(max(results)) +print(min(results)) \ No newline at end of file From 36f35e604ea38300a9e4a67b897b050d0a15a936 Mon Sep 17 00:00:00 2001 From: Jaehyun Kim Date: Sat, 14 May 2022 21:02:24 +0900 Subject: [PATCH 42/50] Create 2960.c --- .../2960.c" | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 "sources/rlapo213_\352\271\200\354\236\254\355\230\204/2960.c" diff --git "a/sources/rlapo213_\352\271\200\354\236\254\355\230\204/2960.c" "b/sources/rlapo213_\352\271\200\354\236\254\355\230\204/2960.c" new file mode 100644 index 0000000..1594bad --- /dev/null +++ "b/sources/rlapo213_\352\271\200\354\236\254\355\230\204/2960.c" @@ -0,0 +1,23 @@ +#include +int n, k; +int main() { + int u[1001]; + scanf("%d %d", &n, &k); + int cnt = 0; + for (int i = 2; i <= n; i++) + u[i] = i; + for (int i = 2; i <= n; i++) { + if (!u[i]) + continue; + for (int j = i; j <= n; j += i) { + if (!u[j]) + continue; + cnt++; + if (cnt == k) { + printf("%d", u[j]); + return 0; + } + u[j] = 0; + } + } +} \ No newline at end of file From 76a6e9e4a846572d6e6dc47af95847c43dfd65f5 Mon Sep 17 00:00:00 2001 From: Jaehyun Kim Date: Wed, 18 May 2022 12:37:54 +0900 Subject: [PATCH 43/50] Create 1205.c --- .../1205.c" | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 "sources/rlapo213_\352\271\200\354\236\254\355\230\204/1205.c" diff --git "a/sources/rlapo213_\352\271\200\354\236\254\355\230\204/1205.c" "b/sources/rlapo213_\352\271\200\354\236\254\355\230\204/1205.c" new file mode 100644 index 0000000..7a1eaa0 --- /dev/null +++ "b/sources/rlapo213_\352\271\200\354\236\254\355\230\204/1205.c" @@ -0,0 +1,23 @@ +#include +int n, p; +int li[100]; +unsigned long long int a,new_num; +int main() { + scanf("%d %d %d", &n, &new_num, &p); + for (int i = 0; i < n; i++) { + scanf("%lld", &li[i]); + } + int rcnt = 1; + int cnt = 0; + for (int i = 0; i < n; i++) { + if (li[i] > new_num) + rcnt++; + else if (li[i] == new_num) + cnt++; + } + if (cnt+rcnt <= p) + printf("%d", rcnt); + else + printf("-1"); + +} \ No newline at end of file From cf6c88af22085f58a4d5ec6dba2b400a45f5a2cc Mon Sep 17 00:00:00 2001 From: Jung haesung <48352078+XxCtrlZxX@users.noreply.github.com> Date: Fri, 20 May 2022 10:57:27 +0900 Subject: [PATCH 44/50] modify file name --- .../step/14 number_combi/1010.py" | 0 .../step/14 number_combi/11051.py" | 0 .../step/14 number_combi/1676.py" | 0 .../step/14 number_combi/1934.py" | 0 .../step/14 number_combi/2004.py" | 0 .../step/14 number_combi/2981.py" | 0 .../step/14 number_combi/3036.py" | 0 .../step/14 number_combi/5086.py" | 0 .../step/14 number_combi/9375.py" | 0 .../step/15 backtracking/15649.py" | 0 .../step/15 backtracking/15650.py" | 0 11 files changed, 0 insertions(+), 0 deletions(-) rename "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/12 number_set/1010.py" => "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/14 number_combi/1010.py" (100%) rename "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/12 number_set/11051.py" => "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/14 number_combi/11051.py" (100%) rename "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/12 number_set/1676.py" => "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/14 number_combi/1676.py" (100%) rename "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/12 number_set/1934.py" => "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/14 number_combi/1934.py" (100%) rename "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/12 number_set/2004.py" => "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/14 number_combi/2004.py" (100%) rename "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/12 number_set/2981.py" => "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/14 number_combi/2981.py" (100%) rename "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/12 number_set/3036.py" => "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/14 number_combi/3036.py" (100%) rename "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/12 number_set/5086.py" => "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/14 number_combi/5086.py" (100%) rename "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/12 number_set/9375.py" => "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/14 number_combi/9375.py" (100%) rename "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/13 backtracking/15649.py" => "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/15 backtracking/15649.py" (100%) rename "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/13 backtracking/15650.py" => "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/15 backtracking/15650.py" (100%) diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/12 number_set/1010.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/14 number_combi/1010.py" similarity index 100% rename from "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/12 number_set/1010.py" rename to "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/14 number_combi/1010.py" diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/12 number_set/11051.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/14 number_combi/11051.py" similarity index 100% rename from "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/12 number_set/11051.py" rename to "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/14 number_combi/11051.py" diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/12 number_set/1676.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/14 number_combi/1676.py" similarity index 100% rename from "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/12 number_set/1676.py" rename to "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/14 number_combi/1676.py" diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/12 number_set/1934.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/14 number_combi/1934.py" similarity index 100% rename from "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/12 number_set/1934.py" rename to "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/14 number_combi/1934.py" diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/12 number_set/2004.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/14 number_combi/2004.py" similarity index 100% rename from "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/12 number_set/2004.py" rename to "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/14 number_combi/2004.py" diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/12 number_set/2981.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/14 number_combi/2981.py" similarity index 100% rename from "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/12 number_set/2981.py" rename to "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/14 number_combi/2981.py" diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/12 number_set/3036.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/14 number_combi/3036.py" similarity index 100% rename from "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/12 number_set/3036.py" rename to "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/14 number_combi/3036.py" diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/12 number_set/5086.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/14 number_combi/5086.py" similarity index 100% rename from "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/12 number_set/5086.py" rename to "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/14 number_combi/5086.py" diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/12 number_set/9375.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/14 number_combi/9375.py" similarity index 100% rename from "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/12 number_set/9375.py" rename to "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/14 number_combi/9375.py" diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/13 backtracking/15649.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/15 backtracking/15649.py" similarity index 100% rename from "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/13 backtracking/15649.py" rename to "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/15 backtracking/15649.py" diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/13 backtracking/15650.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/15 backtracking/15650.py" similarity index 100% rename from "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/13 backtracking/15650.py" rename to "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/15 backtracking/15650.py" From 178c07b4f26a6087b860aa41dd7e8aedb397c7cd Mon Sep 17 00:00:00 2001 From: Jung haesung <48352078+XxCtrlZxX@users.noreply.github.com> Date: Fri, 20 May 2022 11:22:22 +0900 Subject: [PATCH 45/50] 3034 --- .../step/13 \352\270\260\355\225\2301/3034.py" | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/13 \352\270\260\355\225\2301/3034.py" diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/13 \352\270\260\355\225\2301/3034.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/13 \352\270\260\355\225\2301/3034.py" new file mode 100644 index 0000000..c740b32 --- /dev/null +++ "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/13 \352\270\260\355\225\2301/3034.py" @@ -0,0 +1,5 @@ +N, W, H = map(int, input().split()) +d = (W**2 + H**2)**0.5 +for _ in range(N): + n = int(input()) + print("DA" if n <= d else "NE") \ No newline at end of file From 4cef8e271e0b641274ce51378b9f090e9f3d6020 Mon Sep 17 00:00:00 2001 From: cometj03 Date: Fri, 17 Jun 2022 19:31:43 +0900 Subject: [PATCH 46/50] 1904 --- .../step/16 dp/1904.c" | 15 +++++++++++++++ .../step/16 dp/1904.py" | 11 +++++++++++ 2 files changed, 26 insertions(+) create mode 100644 "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/16 dp/1904.c" create mode 100644 "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/16 dp/1904.py" diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/16 dp/1904.c" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/16 dp/1904.c" new file mode 100644 index 0000000..993f02b --- /dev/null +++ "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/16 dp/1904.c" @@ -0,0 +1,15 @@ +#include + +int dp[1000001] = { + 0, + 1, + 2, +}; +int main() +{ + int N; + scanf("%d", &N); + for (int i = 3; i <= N; i++) + dp[i] = (dp[i - 1] + dp[i - 2]) % 15746; + printf("%d\n", dp[N]); +} \ No newline at end of file diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/16 dp/1904.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/16 dp/1904.py" new file mode 100644 index 0000000..ca9dd3c --- /dev/null +++ "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/16 dp/1904.py" @@ -0,0 +1,11 @@ +import sys +input = sys.stdin.readline + +N = int(input()) + +dp = [0, 1, 2] + [0]*N + +for i in range(3, N+1): + dp[i] = (dp[i-1] + dp[i-2]) % 15746 + +print(dp[N]) \ No newline at end of file From 5eef623d01121f9672ab2882b1cceb4f4431b359 Mon Sep 17 00:00:00 2001 From: cometj03 Date: Fri, 17 Jun 2022 19:34:09 +0900 Subject: [PATCH 47/50] dp problems --- .../step/16 dp/24416.py" | 21 ++++++++++++++++ .../step/16 dp/9184.py" | 25 +++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/16 dp/24416.py" create mode 100644 "sources/cometj03_\354\240\225\355\225\264\354\204\261/step/16 dp/9184.py" diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/16 dp/24416.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/16 dp/24416.py" new file mode 100644 index 0000000..99b2beb --- /dev/null +++ "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/16 dp/24416.py" @@ -0,0 +1,21 @@ +cnt = 0 +cnt_dp = 0 +def fib(n): + global cnt + if (n == 1 or n == 2): + cnt += 1 + return 1; + return fib(n-1) + fib(n-2) + +def fibonacci(n): + global cnt_dp + f = [0, 1, 1] + for i in range(3, n+1): + cnt_dp += 1 + f.append(f[i-1] + f[i-2]) + return f[n] + +n = int(input()) +fib(n) +fibonacci(n) +print(cnt, cnt_dp) \ No newline at end of file diff --git "a/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/16 dp/9184.py" "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/16 dp/9184.py" new file mode 100644 index 0000000..56aa8f7 --- /dev/null +++ "b/sources/cometj03_\354\240\225\355\225\264\354\204\261/step/16 dp/9184.py" @@ -0,0 +1,25 @@ +arr = [[[0]*51 for _ in range(51)] for _ in range(51)] + +def w(a, b, c): + if a <= 0 or b <= 0 or c <= 0: + return 1 + if a > 20 or b > 20 or c > 20: + return w(20, 20, 20) + + T = arr[a][b][c] + if T: return T + + if a < b < c: + T = w(a, b, c-1) + w(a, b-1, c-1) - w(a, b-1, c) + arr[a][b][c] = T + return T + + T = w(a-1, b, c) + w(a-1, b-1, c) + w(a-1, b, c-1) - w(a-1, b-1, c-1) + arr[a][b][c] = T + return T + +while True: + a, b, c = map(int, input().split()) + if a == b == c == -1: + break + print(f"w({a}, {b}, {c}) = {w(a, b, c)}") \ No newline at end of file From 5cda8ac52a75cdf426b7822de33ba6d8101dcf6a Mon Sep 17 00:00:00 2001 From: Jaehyun Kim Date: Sun, 26 Jun 2022 06:42:20 +0900 Subject: [PATCH 48/50] Create 1105.c --- .../1105.c" | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 "sources/rlapo213_\352\271\200\354\236\254\355\230\204/1105.c" diff --git "a/sources/rlapo213_\352\271\200\354\236\254\355\230\204/1105.c" "b/sources/rlapo213_\352\271\200\354\236\254\355\230\204/1105.c" new file mode 100644 index 0000000..9605fc3 --- /dev/null +++ "b/sources/rlapo213_\352\271\200\354\236\254\355\230\204/1105.c" @@ -0,0 +1,43 @@ +#include +long long int L, R,Lcpy,Rcpy; +int mcnt = 9, cnt, Lcnt,Rcnt; +int main() { + scanf("%lld %lld", &L, &R); + Lcpy = L; + Rcpy = R; + while (1) { + Lcpy /= 10; + Lcnt++; + if (!Lcpy)break; + } + + while (1) { + Rcpy /= 10; + Rcnt++; + if (!Rcpy)break; + } + if (Rcnt != Lcnt) { + printf("0"); + } + else { + for (long long int i = L; i < R + 1; i++) { + long long int u = i; + cnt = 0; + while (1) { + int k = u % 10; + if (k == 8) + cnt++; + u /= 10; + if (!u)break; + } + if (cnt < mcnt) + mcnt = cnt; + if (!mcnt) + break; + } + printf("%d", mcnt); + } + + + return 0; +} \ No newline at end of file From 627a9a5e6f83e23a512eaa2b9899aeeacfdec7cb Mon Sep 17 00:00:00 2001 From: Jaehyun Kim Date: Fri, 8 Jul 2022 16:42:45 +0900 Subject: [PATCH 49/50] Create 9466.cpp --- .../9466.cpp" | 86 +++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 "sources/rlapo213_\352\271\200\354\236\254\355\230\204/9466.cpp" diff --git "a/sources/rlapo213_\352\271\200\354\236\254\355\230\204/9466.cpp" "b/sources/rlapo213_\352\271\200\354\236\254\355\230\204/9466.cpp" new file mode 100644 index 0000000..a71df39 --- /dev/null +++ "b/sources/rlapo213_\352\271\200\354\236\254\355\230\204/9466.cpp" @@ -0,0 +1,86 @@ +#include +using namespace std; +int t, n, nxt; + +int main() { + cin.tie(0); + ios::sync_with_stdio(0); + cout.tie(0); + + cin >> t; + + while (t--) { + + cin >> n; + + int l[100004]; + int c[100004]; + fill(c, c + n + 1, -2); + queuem; + + for (int i = 1; i <= n; i++) + cin >> l[i]; + + for (int s = 1; s <= n; s++) { + if (c[s] == 0) + continue; + + nxt = l[s]; + m.push(s); + c[s] = 1; //start + + while (1) { + + + if (c[nxt] == 1) { // 1 + c[nxt] = 0; + break; + + } + + else if (c[nxt] == -2) { //not visited + c[nxt] = 0; + m.push(nxt); + nxt = l[nxt]; + } + + else { + while (!m.empty()) { + + if (l[m.back()] == m.front()) { + break; + } + c[m.front()] = -1; + + m.pop(); + + } + break; + } + } + + while (!m.empty()) { + + m.pop(); + + } + + } + + int cnt = 0; + + for (int s = 1; s <= n; s++) { + + if (c[s] == -1) + + cnt++; + + } + + cout << cnt << '\n'; + + } + + return 0; + +} \ No newline at end of file From 706733c0277cf95bad0bde5f274f250cc2b87672 Mon Sep 17 00:00:00 2001 From: Jaehyun Kim Date: Sat, 9 Jul 2022 11:58:01 +0900 Subject: [PATCH 50/50] Create 1402.cpp --- .../1402.cpp" | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 "sources/rlapo213_\352\271\200\354\236\254\355\230\204/1402.cpp" diff --git "a/sources/rlapo213_\352\271\200\354\236\254\355\230\204/1402.cpp" "b/sources/rlapo213_\352\271\200\354\236\254\355\230\204/1402.cpp" new file mode 100644 index 0000000..1432be8 --- /dev/null +++ "b/sources/rlapo213_\352\271\200\354\236\254\355\230\204/1402.cpp" @@ -0,0 +1,12 @@ +#include +using namespace std; +int t, a, b; +int main() { + cin >> t; + while (t--) { + cin >> a >> b; + + cout << "yes" << '\n'; + + } +} \ No newline at end of file