DCP-117: Not Easy But Not Hard Back to All Problems

Beginner Beginners Problems > Ad-hoc


Given a positive integer n. Turist has asked you to calculate the following sum in the most efficient way : Sum= 1 + 2 + 3 +……........ + n Input ----- The first line of input contains an integer T(1<=1000) denoting the number of test cases. The description of T test cases follows.The only line describing each test case contains a single integer n (1<=n<=10^8) . Output ------ For each test case, output a single line containing one integer . Sample Input ------------ 4 3 2 1 10 Sample Output ------------- 6 3 1 55


Problem Setter:

Anowar Hossain Anu

Please login to submit solution to this problem.

Problem Limits

Language Time Limit (seconds)
C 1.00
C++ 1.00
C++14 1.00
C# 3.00
Go 3.00
Java 3.00
JavaScript 3.00
Objective-C 3.00
Perl 3.00
PHP 3.00
Python 3.00
Python3 3.00
Ruby 3.00
VB.Net 3.00

Problem Stats

418/1097

Solve/Submission

Ranking

# User Language Timing
01 naim2711 Cpp14 0.00s
02 duronto20 Cpp 0.00s
03 shawon100 Cpp 0.00s
04 Core_i14 Cpp14 0.00s
05 Alamgir_Hossain Cpp14 0.00s
06 rockersabbir Cpp 0.00s
07 Maruf1355 C 0.00s
08 reza_ul Cpp14 0.00s
09 maxhasan Cpp14 0.00s
10 robin_aust Cpp14 0.00s
11 gazi93 Cpp14 0.00s
12 joy25896 Cpp14 0.00s
13 shafayet_hossain Cpp 0.00s
14 Aman_khan Cpp14 0.00s
15 rayhan50001 Cpp14 0.00s
16 wizard Cpp 0.00s
17 non_coder Cpp14 0.00s
18 pulak_ict_mbstu Cpp14 0.00s
19 Anubis Cpp14 0.00s
20 linkon Cpp 0.00s
21 rezaul_karim Cpp14 0.00s
22 afzalul Cpp14 0.00s
23 Azman_Amin Cpp14 0.00s
24 virus C 0.00s
25 Nurul_CSE Cpp14 0.00s
26 junayedmahmud Cpp14 0.00s
27 Indro_BU Cpp14 0.00s
28 feodorv C 0.00s
29 kpretomazi Cpp 0.00s
30 Freaky_Weirdo Cpp 0.00s
31 neel71 C 0.00s
32 leenaiitju C 0.00s
33 gulzar Cpp14 0.00s
34 JubayerSohel Cpp14 0.00s
35 seyedssz Cpp14 0.00s
36 Mehedi07 Cpp14 0.00s
37 nurul_islam Cpp14 0.00s
38 return_SS Cpp14 0.00s
39 rafsandevs Cpp14 0.00s
40 Mhkhaled Cpp14 0.00s
41 Sharif_42 Cpp14 0.00s
42 MarufAhmed Cpp 0.00s
43 Beauty Cpp14 0.00s
44 Not_Found0001 Cpp14 0.00s
45 terminator_c Cpp14 0.00s
46 Salty_Coder Cpp14 0.00s
47 Avijeet Cpp14 0.00s
48 tssovi Cpp14 0.00s
49 Eucalyptus Cpp14 0.00s
50 jayed_al_hasan Cpp14 0.00s
Feedback

Your feedback is our precious!



Or call +88 02 9853138 for support