I would like to thank all the participants for their participation hope you enjoyed the problems , I'm Really Shocked to reach about 100 participants joined the contest Problems
Hope You Guys Enjoyed The Contest Stay Tuned For More ! Best Wishes
# | User | Rating |
---|---|---|
1 | tourist | 3985 |
2 | jiangly | 3814 |
3 | jqdai0815 | 3682 |
4 | Benq | 3529 |
5 | orzdevinwang | 3526 |
6 | ksun48 | 3517 |
7 | Radewoosh | 3410 |
8 | hos.lyric | 3399 |
9 | ecnerwala | 3392 |
9 | Um_nik | 3392 |
# | User | Contrib. |
---|---|---|
1 | cry | 169 |
2 | maomao90 | 162 |
2 | Um_nik | 162 |
4 | atcoder_official | 161 |
5 | djm03178 | 158 |
6 | -is-this-fft- | 157 |
7 | adamant | 155 |
8 | Dominater069 | 154 |
8 | awoo | 154 |
10 | luogu_official | 150 |
I would like to thank all the participants for their participation hope you enjoyed the problems , I'm Really Shocked to reach about 100 participants joined the contest Problems
The Sum $$$\sum_{x=1}^{n}x^3$$$ has a closed form which is $$$(\frac{n(n+1)}{2})^2$$$
x=int(input())
print(x*(x+1)*x*(x+1)//4)
since the sum of numbers from $$$1$$$ to $$$n$$$ has a closed form $$$\frac{n(n+1)}{2}$$$ we can obtain the missing number by sum all the numbers from $$${1}$$$ to $$${n}$$$ (inclusive) and then sum the given numbers $$${x_1,x_2,x_3...,x_{n-1}}$$$ and find the difference so the final solution is $$$\frac{n(n+1)}{2}-\sum_{i=1}^{n-1}x_i$$$
n=int(input())
x=list(map(int,input().split()))
print(n*(n+1)//2-sum(x))
The Idea Here is Linearize the Time Complexity by using efficient popular algorithm called "Kadane's Algorithm" that maximize the sum in each iteration to get with the maximum subarray in $$$O(n)$$$ time complexity
n=int(input())
x=list(map(int,input().split()))
sm,best=0,0
for i in range(len(x)):
sm=max(x[i],sm+x[i])
best=max(best,sm)
print(best)
The Idea is to (string add) numbers even with themselves , so if we have n numbers then we will have $$$n*n=n^2$$$ (string add) operations that means that Time Complexity Here will Be $$$O(n^2)$$$ and of course in the iteration converting the string to integer and adding to the sum
n=int(input())
x=input().split()
ar=[]
for i in range(n):
for j in range(n):
ar.append(x[i]+x[j])
ar=list(map(int,ar))
print(sum(ar))
The Idea here is to find how many (Integer-Pairs) we can make using number $$$n$$$ , most of solution used // operation which can lies on large values so it's preferred to use math library which is already designed well to hold large values so floor is better choice so that answer is $$$\lfloor \frac{x}{2} \rfloor$$$
from math import *
print(floor(int(input())/2))
Hope You Guys Enjoyed The Contest Stay Tuned For More ! Best Wishes
Hello CodeForces community,
I'm really stuck on what the common ideas for Div. 3 (ABC) are.
Can you guide me on the skills needed?
'm requested to build a Mathematical Contest Site , The Contest and The Rating System won't be as complicated as CodeForces system since The Answer will be numerical value , so , Any Expert Here To Tell Me The Approach for Such thing and the best system of rating to get nearly accurate level of experience of contestant.
Hi CodeForces ... In usual math plays a very important rule in Competitive Programming .. So I want to know the full and simple Book or Youtube Channel for this Topic ... That's it thank you...
Name |
---|