From dd684349c67c988ef19707cb65e637b6906fac75 Mon Sep 17 00:00:00 2001 From: omagdy7 Date: Fri, 8 Jul 2022 19:54:42 +0200 Subject: Solved some new problems --- codechef/TheSmallestPair/main | Bin 0 -> 44568 bytes codechef/TheSmallestPair/main.cpp | 18 ++++++++++++++++++ codechef/TheSmallestPair/main_input0.txt | 3 +++ codechef/TheSmallestPair/main_output0.txt | 1 + 4 files changed, 22 insertions(+) create mode 100755 codechef/TheSmallestPair/main create mode 100644 codechef/TheSmallestPair/main.cpp create mode 100644 codechef/TheSmallestPair/main_input0.txt create mode 100644 codechef/TheSmallestPair/main_output0.txt (limited to 'codechef/TheSmallestPair') diff --git a/codechef/TheSmallestPair/main b/codechef/TheSmallestPair/main new file mode 100755 index 0000000..08ae671 Binary files /dev/null and b/codechef/TheSmallestPair/main differ diff --git a/codechef/TheSmallestPair/main.cpp b/codechef/TheSmallestPair/main.cpp new file mode 100644 index 0000000..7b77a41 --- /dev/null +++ b/codechef/TheSmallestPair/main.cpp @@ -0,0 +1,18 @@ +#include + +using namespace std; + +int main () { + ios_base::sync_with_stdio(false); + cin.tie(NULL); + int tt; + cin >> tt; + while(tt--){ + int n; + cin >> n; + vector v(n); + for(int& x : v) cin >> x; + sort(v.begin(), v.end()); + cout << v[0] + v[1] << endl; + } +} diff --git a/codechef/TheSmallestPair/main_input0.txt b/codechef/TheSmallestPair/main_input0.txt new file mode 100644 index 0000000..ab88d90 --- /dev/null +++ b/codechef/TheSmallestPair/main_input0.txt @@ -0,0 +1,3 @@ +1 +4 +5 1 3 4 diff --git a/codechef/TheSmallestPair/main_output0.txt b/codechef/TheSmallestPair/main_output0.txt new file mode 100644 index 0000000..b8626c4 --- /dev/null +++ b/codechef/TheSmallestPair/main_output0.txt @@ -0,0 +1 @@ +4 -- cgit v1.2.3