diff options
| author | Omar Magdy <omar.professional8777@gmail.com> | 2022-06-21 15:06:29 +0200 |
|---|---|---|
| committer | Omar Magdy <omar.professional8777@gmail.com> | 2022-06-21 15:06:29 +0200 |
| commit | 42013225064413fdb31599d1b3304065c3964707 (patch) | |
| tree | 932de94c62961c5db86f623b82079fb13f2e8dcd | |
| parent | b1828ab2fe7eaedc3104e5c2b46eb08940299738 (diff) | |
| download | competitive-programming-42013225064413fdb31599d1b3304065c3964707.tar.xz competitive-programming-42013225064413fdb31599d1b3304065c3964707.zip | |
Solved collegeLife2 from codechef
| -rwxr-xr-x | codechef/collegLife2/main | bin | 0 -> 27320 bytes | |||
| -rw-r--r-- | codechef/collegLife2/main.cpp | 25 | ||||
| -rw-r--r-- | codechef/collegLife2/main_input0.txt | 5 | ||||
| -rw-r--r-- | codechef/collegLife2/main_input1.txt | 11 | ||||
| -rw-r--r-- | codechef/collegLife2/main_output0.txt | 1 | ||||
| -rw-r--r-- | codechef/collegLife2/main_output1.txt | 2 |
6 files changed, 40 insertions, 4 deletions
diff --git a/codechef/collegLife2/main b/codechef/collegLife2/main Binary files differnew file mode 100755 index 0000000..40e3eb4 --- /dev/null +++ b/codechef/collegLife2/main diff --git a/codechef/collegLife2/main.cpp b/codechef/collegLife2/main.cpp index 0e72523..231767f 100644 --- a/codechef/collegLife2/main.cpp +++ b/codechef/collegLife2/main.cpp @@ -8,9 +8,26 @@ int main () { int tt; cin >> tt; while(tt--){ - int s; - vector<int> q(s); - - + int s, introLength, numberOfEposides, eposideLength; + long long ans = 0; + cin >> s; + vector<int> seasons(s); // array containg the introLength of each season + for(auto &x : seasons) { + cin >> x; + } + for(int i = 0 ; i < s; i++) { + cin >> numberOfEposides; + for(int j = 0; j < numberOfEposides; j++) { + int x; + cin >> x; + if(j == 0) { + ans += x; + } + if(j > 0) { + ans += x - seasons[i]; + } + } + } + cout << ans << endl; } } diff --git a/codechef/collegLife2/main_input0.txt b/codechef/collegLife2/main_input0.txt new file mode 100644 index 0000000..146fb12 --- /dev/null +++ b/codechef/collegLife2/main_input0.txt @@ -0,0 +1,5 @@ +1 +2 +1 2 +1 2 +2 3 4 diff --git a/codechef/collegLife2/main_input1.txt b/codechef/collegLife2/main_input1.txt new file mode 100644 index 0000000..f30cc97 --- /dev/null +++ b/codechef/collegLife2/main_input1.txt @@ -0,0 +1,11 @@ +2 +1 +10 +5 11 11 11 11 11 +5 +10 10 10 10 10 +1 11 +1 11 +1 11 +1 11 +1 11 diff --git a/codechef/collegLife2/main_output0.txt b/codechef/collegLife2/main_output0.txt new file mode 100644 index 0000000..7f8f011 --- /dev/null +++ b/codechef/collegLife2/main_output0.txt @@ -0,0 +1 @@ +7 diff --git a/codechef/collegLife2/main_output1.txt b/codechef/collegLife2/main_output1.txt new file mode 100644 index 0000000..1ec0d94 --- /dev/null +++ b/codechef/collegLife2/main_output1.txt @@ -0,0 +1,2 @@ +15 +55 |
