diff options
| author | Omar Magdy <omar.professional8777@gmail.com> | 2022-06-24 13:49:34 +0200 |
|---|---|---|
| committer | Omar Magdy <omar.professional8777@gmail.com> | 2022-06-24 13:49:34 +0200 |
| commit | 5555c7da69b13eb9f6c81c21e6d0f5a5cc702b08 (patch) | |
| tree | 65628c828872d95f483982ce37644e0ac9420393 /codechef | |
| parent | 42013225064413fdb31599d1b3304065c3964707 (diff) | |
| download | competitive-programming-5555c7da69b13eb9f6c81c21e6d0f5a5cc702b08.tar.xz competitive-programming-5555c7da69b13eb9f6c81c21e6d0f5a5cc702b08.zip | |
Solved a problem from codechef
Diffstat (limited to 'codechef')
| -rw-r--r-- | codechef/copsAndTheifDevu/inp | 0 | ||||
| -rwxr-xr-x | codechef/copsAndTheifDevu/main | bin | 0 -> 43304 bytes | |||
| -rw-r--r-- | codechef/copsAndTheifDevu/main.cpp | 24 | ||||
| -rw-r--r-- | codechef/copsAndTheifDevu/main_input0.txt | 7 | ||||
| -rw-r--r-- | codechef/copsAndTheifDevu/main_output0.txt | 3 |
5 files changed, 34 insertions, 0 deletions
diff --git a/codechef/copsAndTheifDevu/inp b/codechef/copsAndTheifDevu/inp new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/codechef/copsAndTheifDevu/inp diff --git a/codechef/copsAndTheifDevu/main b/codechef/copsAndTheifDevu/main Binary files differnew file mode 100755 index 0000000..c9cc83b --- /dev/null +++ b/codechef/copsAndTheifDevu/main diff --git a/codechef/copsAndTheifDevu/main.cpp b/codechef/copsAndTheifDevu/main.cpp new file mode 100644 index 0000000..914c012 --- /dev/null +++ b/codechef/copsAndTheifDevu/main.cpp @@ -0,0 +1,24 @@ +#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 m, x, y; + cin >> m >> x >> y; + vector<int> v(m); + for(int &x : v) cin >> x; + set<int> st; + for(int i = 0; i < v.size(); i++) { + for(int j = max(v[i] - (x * y) - 1, 0); j < min(v[i] + (x * y), 100); j++) { + st.insert(j); + } + } + cout << 100 - st.size() << endl; + + } +} diff --git a/codechef/copsAndTheifDevu/main_input0.txt b/codechef/copsAndTheifDevu/main_input0.txt new file mode 100644 index 0000000..b47d21b --- /dev/null +++ b/codechef/copsAndTheifDevu/main_input0.txt @@ -0,0 +1,7 @@ +3 +4 7 8 +12 52 56 8 +2 10 2 +21 75 +2 5 8 +10 51 diff --git a/codechef/copsAndTheifDevu/main_output0.txt b/codechef/copsAndTheifDevu/main_output0.txt new file mode 100644 index 0000000..5e66023 --- /dev/null +++ b/codechef/copsAndTheifDevu/main_output0.txt @@ -0,0 +1,3 @@ +0 +18 +9 |
