CPU: 0.5s
Memory: 1024MB
তোমাকে পূর্ণ সংখ্যার একটি অ্যারে দেয়া হবে। তোমাকে অ্যারের প্রথম সংখ্যাটি থেকে শুরু করে, পরপর দুটি সংখ্যা না নিয়ে অ্যারেটির সঙ্খাগুলোর যোগফল বের করতে হবে।
You will be given an array of integer numbers as input. Starting with the first number, you have to find the sum of the numbers in the array such that you cannot take two successive numbers in the sum.
ইনপুটের বর্ণনা
লাইন ১ – ইন্টিজার N, অ্যারেটিতে নম্বরের সংখ্যা। (1 ≤ 𝑁 ≤ 100000)
লাইন ২ – Nটি নম্বরের একটি অ্যারে। 0 ≤ 𝑥 ≤ 2^31
Input Specification
Line 1 – Integer N, the number of integers in the series ( 1 ≤ 𝑁 ≤ 100000 )
Line 2 – A series of N integers in the range.0 ≤ 𝑥 ≤ 2^ 31
আউটপুট এর বর্ণনা
অ্যারের প্রথম নম্বরটি থেকে শুরু করে, পরপর দুটি নম্বর না নিয়ে অ্যারেটির সংখ্যাগুলোর যোগফল বের কর।
Output Specification
Starting with the first one, output the sum of the numbers in the series without taking two successive numbers.
Samples
Input | Output |
---|---|
2 1 0 | 1 |
Input | Output |
---|---|
3 1 2 3 | 4 |