summaryrefslogtreecommitdiff
path: root/10954
diff options
context:
space:
mode:
authorAditya Naik2020-06-08 21:17:18 -0400
committerAditya Naik2020-06-08 21:17:18 -0400
commit36e8897c90442cd558cdddf3f2ae38f148ac5581 (patch)
tree9f62cfe733ffced1fa7a0916750ac24af5ac5112 /10954
parent7f1d8a56cd3d5065e442b8e592ffe17d40d4c3d2 (diff)
Older files and necklace
Diffstat (limited to '10954')
-rw-r--r--10954/addall.py16
-rw-r--r--10954/in9
2 files changed, 25 insertions, 0 deletions
diff --git a/10954/addall.py b/10954/addall.py
new file mode 100644
index 0000000..bb45348
--- /dev/null
+++ b/10954/addall.py
@@ -0,0 +1,16 @@
+import sys
+
+while True:
+ line=sys.stdin.readline()
+ line=sys.stdin.readline()
+ lineint=[int(i) for i in line.rstrip().split(" ")]
+ curr_sum=lineint[0]
+ cost=0
+ for x in range(1, len(lineint)):
+ curr_sum+=lineint[x]
+ cost+=curr_sum
+ print(cost)
+ print(curr_sum)
+ print(sorted(lineint))
+ break
+
diff --git a/10954/in b/10954/in
new file mode 100644
index 0000000..7ca45da
--- /dev/null
+++ b/10954/in
@@ -0,0 +1,9 @@
+17
+7 6 60 70 78 44 86 21 7 11 33 44 93 87 68 72 92
+2
+56 91
+0
+
+ 1 2 3 4
+curr sum 1 3 6 10
+cost 0 3 9 19