aboutsummaryrefslogtreecommitdiff
path: root/codechef/ArmyTraining
diff options
context:
space:
mode:
authoromagdy7 <omar.professional8777@gmail.com>2022-07-08 19:54:42 +0200
committeromagdy7 <omar.professional8777@gmail.com>2022-07-08 19:54:42 +0200
commitdd684349c67c988ef19707cb65e637b6906fac75 (patch)
tree2fd9ac45ef08351c8164eda640dade2890f4c731 /codechef/ArmyTraining
parent4688ed5f3a56ac6698250e2169adbfbe53b8b685 (diff)
downloadcompetitive-programming-dd684349c67c988ef19707cb65e637b6906fac75.tar.xz
competitive-programming-dd684349c67c988ef19707cb65e637b6906fac75.zip
Solved some new problems
Diffstat (limited to 'codechef/ArmyTraining')
-rwxr-xr-xcodechef/ArmyTraining/mainbin0 -> 22576 bytes
-rw-r--r--codechef/ArmyTraining/main.cpp25
-rw-r--r--codechef/ArmyTraining/main_input0.txt9
-rw-r--r--codechef/ArmyTraining/main_output0.txt4
4 files changed, 38 insertions, 0 deletions
diff --git a/codechef/ArmyTraining/main b/codechef/ArmyTraining/main
new file mode 100755
index 0000000..527b3b4
--- /dev/null
+++ b/codechef/ArmyTraining/main
Binary files differ
diff --git a/codechef/ArmyTraining/main.cpp b/codechef/ArmyTraining/main.cpp
new file mode 100644
index 0000000..a85f4f3
--- /dev/null
+++ b/codechef/ArmyTraining/main.cpp
@@ -0,0 +1,25 @@
+#include<bits/stdc++.h>
+
+using namespace std;
+
+int main () {
+ ios_base::sync_with_stdio(false);
+ cin.tie(NULL);
+ int tt;
+ cin >> tt;
+ while(tt--){
+ int n;
+ cin >> n;
+ long long att = 0;
+ long long def = 0;
+ for(int i = 0; i < n; i++) {
+ int x;
+ cin >> x;
+ if(x <= 500) {
+ def += 1000 - x;
+ } else {
+ att += x;
+ }
+ }
+ }
+}
diff --git a/codechef/ArmyTraining/main_input0.txt b/codechef/ArmyTraining/main_input0.txt
new file mode 100644
index 0000000..551ceff
--- /dev/null
+++ b/codechef/ArmyTraining/main_input0.txt
@@ -0,0 +1,9 @@
+4
+2
+500 500
+3
+500 500 500
+4
+100 800 300 500
+4
+300 700 800 200
diff --git a/codechef/ArmyTraining/main_output0.txt b/codechef/ArmyTraining/main_output0.txt
new file mode 100644
index 0000000..cbc7a89
--- /dev/null
+++ b/codechef/ArmyTraining/main_output0.txt
@@ -0,0 +1,4 @@
+250000
+500000
+2080000
+2250000