From 18799a682fd4452bef2366c6db0135913153aba3 Mon Sep 17 00:00:00 2001 From: rnlcksgek <63949709+rnlcksgek@users.noreply.github.com> Date: Thu, 21 May 2020 20:50:54 +0900 Subject: [PATCH 1/6] Create rnlcksgek --- rnlcksgek | 1 + 1 file changed, 1 insertion(+) create mode 100644 rnlcksgek diff --git a/rnlcksgek b/rnlcksgek new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/rnlcksgek @@ -0,0 +1 @@ + From 4e9069680f95af817d24c917c97dbaa98125382e Mon Sep 17 00:00:00 2001 From: rnlcksgek Date: Wed, 8 Jul 2020 15:39:47 +0900 Subject: [PATCH 2/6] =?UTF-8?q?=EA=B7=B8=EB=A6=AC=EB=94=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .DS_Store | Bin 0 -> 8196 bytes ...0_\354\235\264\354\240\225\354\227\275.py" | 20 +++++ "\354\240\225\353\240\254/.DS_Store" | Bin 0 -> 6148 bytes ...s_\354\235\264\354\240\225\354\227\275.py" | 73 ++++++++++++++++++ 4 files changed, 93 insertions(+) create mode 100644 .DS_Store create mode 100644 "\352\267\270\353\246\254\353\224\224/coin 0_\354\235\264\354\240\225\354\227\275.py" create mode 100644 "\354\240\225\353\240\254/.DS_Store" create mode 100644 "\354\240\225\353\240\254/statistics_\354\235\264\354\240\225\354\227\275.py" diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..1c3e62d659d044163a2de79e3e11766514ff13a3 GIT binary patch literal 8196 zcmeHMO=uHA6n@jD?Iu=CKxq#i_FzFUl!gSM6fvgpP!Loi3RY>8CZwU8osevd8dG!e z=&_)8FN&T#n1gsIA~|`epm_792N6W?`sSy}%(m$<2+qK~Z+6~$`@a3M+1W_|fTZgA z7{D|DSlAhc524woF+b~j+K8Mvjz};coMJ4qM$45wk!HduU=%P47zK<1MuC4t0bH|L zvj(jD!fUKiz$oxvD!`r(Hg<+diEV-W(Se3<0T2T?%^QxxY=CG>OiFAEL=QG1QV~Te zky{KR(sACFaY>17fg&A<+MPT9I_JU5|$rx6kSR{DJ<;y7Jq=4^MaCla$Y`Xl$MT2AE9LB3 ztfmGp4w_$8WRtEg|2)eT@x}C285E-_BkR2U+{Gv0^S2)#zTVO~!&CqDsj)ie;5&>R zSN$sIE%*1r56M}N>2n?wqjOF&)?;rbJKuIXAHHut(HWB|^s1ks5~=f@Skcd;vORUb z$5zQN(>~YzBlclB(mmFR`ZzxDapW<%My(?6#crpWckVXtwKgB& zbzmcMnS>+axMv^Zh+mtg{E7F4-Fa2>$(`O^&2v<>{XR|S8D5X)+{#p4hq^_aVVnrJ z48;O&)_*RQF-C!*D=;c5PP6_0`N6;c51p4OXcRCC3{L?PNN3V1thf8p;4jUVY8(41 tcGg&2TOdzC!&h@ez8y#G{b7h>8$(%6Qes;m&R{by0$c`Ti~>Vd;4hH5TABa= literal 0 HcmV?d00001 diff --git "a/\352\267\270\353\246\254\353\224\224/coin 0_\354\235\264\354\240\225\354\227\275.py" "b/\352\267\270\353\246\254\353\224\224/coin 0_\354\235\264\354\240\225\354\227\275.py" new file mode 100644 index 0000000..0c92f90 --- /dev/null +++ "b/\352\267\270\353\246\254\353\224\224/coin 0_\354\235\264\354\240\225\354\227\275.py" @@ -0,0 +1,20 @@ +import sys + +repeat, num = map(int,sys.stdin.readline().split()) + +money = [int(sys.stdin.readline().strip()) for i in range(repeat)] +cnt = 0 + +while len(money) != 0: + currency = money.pop() + temp = num // currency + if temp >0: + cnt += temp + num -= temp*currency + if num == 0: + break +print(cnt) + + + + diff --git "a/\354\240\225\353\240\254/.DS_Store" "b/\354\240\225\353\240\254/.DS_Store" new file mode 100644 index 0000000000000000000000000000000000000000..6f0524fba539c25236de449331034494b0b05076 GIT binary patch literal 6148 zcmeHKEl&eM5S@V&O)xbLl`9b#{=uec1saPW1=*wue}>c`_&L=i4HZcK54`z+a9ywn z@+O&iw>$Ipa!=gsh=|Va?=D2fA~J#-%Em%#mN#$gD0d9i&bVByZ&zQ?fF67!$F-FGf)94Kn17(6`%q?DuAACHaZDp zqykic3VbPG|AzuMtciV~|2h!t`fmBo&LvwP_pd(+i zz7Gt#sJ|KK right[j]: + temp.append(right[j]) + j += 1 + elif left[i] == right[j]: + temp.append(left[i]) + temp.append(right[j]) + i+=1 + j+=1 + else: + temp.append(left[i]) + i+=1 + + while (imaximum: +# maximum = n +# if n not in dict1: +# dict1[n] = [i] +# else: +# dict1[n].append(i) +# if len(dict1[maximum])<2: +# print(dict1[maximum][0]) +# else: +# print(merge_sort(dict1[maximum])[1]) + +def mode(stats): + from collections import Counter + a = Counter(stats) + a = sorted(a.most_common(), key = lambda x:(-x[1], x[0])) + if len(a)>=2: + print(a[1][0] if a[0][1] == a[1][1] else a[0][0]) + else: + print(a[0][0]) + +import sys +num = [int(sys.stdin.readline()) for i in range(int(sys.stdin.readline().strip()))] +sort_stat = merge_sort(num) +print(round((sum(sort_stat))/(len(sort_stat)))) +print(sort_stat[len(sort_stat)//2]) +mode(sort_stat) +if len(sort_stat) == 1: + print(0) +else: + print(sort_stat[-1] - sort_stat[0]) + + + + From b7e511adaac3973f968941430c0a5b014035c661 Mon Sep 17 00:00:00 2001 From: rnlcksgek Date: Wed, 8 Jul 2020 15:46:13 +0900 Subject: [PATCH 3/6] d --- .DS_Store | Bin 8196 -> 8196 bytes .../.DS_Store" | Bin 0 -> 6148 bytes 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 "\352\267\270\353\246\254\353\224\224/.DS_Store" diff --git a/.DS_Store b/.DS_Store index 1c3e62d659d044163a2de79e3e11766514ff13a3..1d232da5b36189f946e75199f8ed0af5e4b84ff5 100644 GIT binary patch delta 241 zcmZp1XmQxENYFx%M=(`zk07gHy5M@xoc!dZoctsP1_l8J2F6w(t??fWfGh?EHe|Jv zHH5F%qlo0B8wMxm=N5p~s+>zj*O8m=;sQ0DgXdC0^hf(cj+kmv2&yT_fZ3x2)UFD) d4#gp5!9{sF`FZI;8OF`?1QQuIZx#vU1^|tkK79ZH delta 134 zcmZp1XmQxENN{tQa4aJ$(+SZXI+NE4%0pSV1h312#d6XOgOl@f3m8B^seMekdfO3FZ`JASqV`YXXax1sCPzH1@V-^m;4Wg<&0T*E43hX&L&p$$qDprKhvt+--jT7}7np#A3 zem<@ulZcFPQ@L2!n>{z**++&mCkOWA81W14cNZlEfg7;MkzE(HCqgga^y>{tEnwC%0;vJ&^%eQ zLs35+`xjp>T0 Date: Tue, 4 Aug 2020 23:36:00 +0900 Subject: [PATCH 4/6] =?UTF-8?q?=E3=85=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ㅋ --- ...74\341\204\213\341\205\247\341\206\270.py" | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 "\353\217\231\354\240\201 \352\263\204\355\232\215\353\262\225/\355\217\211\353\262\224\355\225\234 \353\260\260\353\202\255/bag \341\204\214\341\205\245\341\206\274\341\204\213\341\205\247\341\206\270.py" diff --git "a/\353\217\231\354\240\201 \352\263\204\355\232\215\353\262\225/\355\217\211\353\262\224\355\225\234 \353\260\260\353\202\255/bag \341\204\214\341\205\245\341\206\274\341\204\213\341\205\247\341\206\270.py" "b/\353\217\231\354\240\201 \352\263\204\355\232\215\353\262\225/\355\217\211\353\262\224\355\225\234 \353\260\260\353\202\255/bag \341\204\214\341\205\245\341\206\274\341\204\213\341\205\247\341\206\270.py" new file mode 100644 index 0000000..105d550 --- /dev/null +++ "b/\353\217\231\354\240\201 \352\263\204\355\232\215\353\262\225/\355\217\211\353\262\224\355\225\234 \353\260\260\353\202\255/bag \341\204\214\341\205\245\341\206\274\341\204\213\341\205\247\341\206\270.py" @@ -0,0 +1,41 @@ +import sys +from collections import defaultdict + +n,k = map(int,sys.stdin.readline().split()) + +answer = defaultdict(list) +for i in range(1,k+1): + answer[i] = float('-inf') + +bags = defaultdict(list) + +for i in range(n): + w,v = map(int,sys.stdin.readline().split()) + if w not in bags: + bags[w] = [v] + else: + bags[w].append(v) + +for i in bags: + bags[i].sort(reverse=True) + +for i in range(1,k+1): + if bags[i] == []: + continue + cnt = 0 + cnt_value = 0 + for j in bags[i]: + cnt+=i + cnt_value += j + if (cnt > k) or (not answer[cnt]): + continue + if answer[cnt] k): + continue + if answer[i+j] Date: Fri, 7 Aug 2020 19:19:24 +0900 Subject: [PATCH 5/6] =?UTF-8?q?=EB=A7=9D=ED=95=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .DS_Store | Bin 8196 -> 6148 bytes .../bag \354\240\225\354\227\275.py" | 41 ++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 "\353\217\231\354\240\201 \352\263\204\355\232\215\353\262\225/\355\217\211\353\262\224\355\225\234 \353\260\260\353\202\255/bag \354\240\225\354\227\275.py" diff --git a/.DS_Store b/.DS_Store index 1d232da5b36189f946e75199f8ed0af5e4b84ff5..b0dbdc20727ebc853578fcbb6888bc81509c841d 100644 GIT binary patch delta 108 zcmZp1XfcprU|?W$DortDU=RQ@Ie-{Mvv5sJ6q~50$SANeU^g?Pz+@hQN1MZhV;MK5 u?qOWa&cPwb3{(XK0^C5t6{KNf;&v1qd=xJY>wxd!wdig4-xqQ delta 724 zcmZoMXmOBWU|?W$DortDU;r^WfEYvza8FDWo2aMAD6=tOH}hr%jz7$c**Q2S7O*hN zOy*&ER4>RNSS-jYSSrXYSn8RRpPZDFp9IneG>rvFZ~qSlKo$c78?xG*bi?4}{M-Vt z41_?D&&_vnfttlpm!A;*(f*Jlx*56oDfI*u6=Yzsh(|D0a1YSg>4NLg9Nh}EL<7aq zNNSVHiwmHRI+0Y6lUZC+Z(wkpk%^gwl?@mwTpV1yT(Q9!`Q^bSi6y1QPKia)AYMRX zNk$Ts9g?4)17{~Dg=MCe#|wx!=jW9qX6B_9fi-8Qqym-1glFcZB3Nm>65u)^c))s~XyRCgfIDRoB$k&47e1 zBO`=n;D^#MY9^4uCWz!ql&DcTmx?Zr95op{myqHH$q-=Nz@rA28kDF}1-l2uA!Wfu zc{%xc=|CCA&97Jz88>g{iDu@K;06k~g3{(@L5}atlletFC;RhoZ~#3BO12D}<9X&V F0{|=EurdGu diff --git "a/\353\217\231\354\240\201 \352\263\204\355\232\215\353\262\225/\355\217\211\353\262\224\355\225\234 \353\260\260\353\202\255/bag \354\240\225\354\227\275.py" "b/\353\217\231\354\240\201 \352\263\204\355\232\215\353\262\225/\355\217\211\353\262\224\355\225\234 \353\260\260\353\202\255/bag \354\240\225\354\227\275.py" new file mode 100644 index 0000000..105d550 --- /dev/null +++ "b/\353\217\231\354\240\201 \352\263\204\355\232\215\353\262\225/\355\217\211\353\262\224\355\225\234 \353\260\260\353\202\255/bag \354\240\225\354\227\275.py" @@ -0,0 +1,41 @@ +import sys +from collections import defaultdict + +n,k = map(int,sys.stdin.readline().split()) + +answer = defaultdict(list) +for i in range(1,k+1): + answer[i] = float('-inf') + +bags = defaultdict(list) + +for i in range(n): + w,v = map(int,sys.stdin.readline().split()) + if w not in bags: + bags[w] = [v] + else: + bags[w].append(v) + +for i in bags: + bags[i].sort(reverse=True) + +for i in range(1,k+1): + if bags[i] == []: + continue + cnt = 0 + cnt_value = 0 + for j in bags[i]: + cnt+=i + cnt_value += j + if (cnt > k) or (not answer[cnt]): + continue + if answer[cnt] k): + continue + if answer[i+j] Date: Wed, 12 Aug 2020 15:17:02 +0900 Subject: [PATCH 6/6] d --- .../BFS DFS/sackxycode.py" | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 "\352\267\270\353\236\230\355\224\204/BFS DFS/sackxycode.py" diff --git "a/\352\267\270\353\236\230\355\224\204/BFS DFS/sackxycode.py" "b/\352\267\270\353\236\230\355\224\204/BFS DFS/sackxycode.py" new file mode 100644 index 0000000..6b52063 --- /dev/null +++ "b/\352\267\270\353\236\230\355\224\204/BFS DFS/sackxycode.py" @@ -0,0 +1,13 @@ +def find(n,k): + if n>= k: + return n-k + elif k == 1: + return 1 + elif k%2: + return min(find(n,k+1),find(n,k-1))+1 + else: + return min(k-n,1+find(n,k//2)) + +import sys +n,k = map(int,sys.stdin.readline().split()) +print(find(n,k))