r/competitivprogramming • • Apr 03 '20

I solved, but the website isn't accepting.

1 Upvotes

can someone please tell me why isn't my code acceptable to the website
here's the problem:
https://hack.codingblocks.com/app/practice/6/1051/problem
here's my code:

lister = []
N,M,K,S = input().split()
lister.append(int(N))
lister.append(int(M))
lister.append(int(K))
lister.append(int(S))
INPUT = []
for b in range(int(lister[1])):
innerINP = []
inPut = input().split()
for a in range(int(lister[0])):
innerINP.append(inPut[a])
INPUT.append(innerINP)
S = lister[3]
flag= True
for b in range(int(lister[1])):
for a in range(int(lister[0])):
if (S < int(K)):
flag = False
break
if(a<=lister[1]-1 and a>0):
S -= 1
if(INPUT[b][a] == '*'):
S += 5
elif(INPUT[b][a] == '.'):
S -= 2
else:
break
if(flag == False):
break
if(S >= int(lister[2])):
print("Yes\n",S)
else:
print("No")


r/competitivprogramming • • Jun 05 '20

How to Deploy Website For Free 2020 | Free Domain | Free Web Hosting | F...

Thumbnail
youtube.com
0 Upvotes

r/competitivprogramming • • Aug 02 '20

Leetcode Sort Colors Solution Explained | C Editorial ๐Ÿ”ฅ

Thumbnail
youtube.com
2 Upvotes

r/competitivprogramming • • Aug 02 '20

How to do this?(explain the logic please)

2 Upvotes

r/competitivprogramming • • Aug 18 '20

TLE

3 Upvotes

Can someone give a detailed solution to the below problem?

https://cses.fi/problemset/task/1141/

I have implemented a solution of O(N log N) average but it is giving tle on some test cases

My solution: https://gist.github.com/Aryamn/0a6a18b3ab37e69df00a0aa99ea0da6d


r/competitivprogramming • • May 04 '20

C++ codeforce problem

1 Upvotes

#include <iostream>

using namespace std;

int main () {

int n, k;

cin >> n >> k;

if (n % 10 == 0) {

return n / 10;

}

else {

for (int i = 0; i < k + 1; i--)

return n / 10;

}

cout << n;

}

can anyone tell me why I keep getting no output or errors? the sample input is 512 for n and 4 for k


r/competitivprogramming • • Mar 04 '20

Can someone please explain the solution to this!!

Thumbnail
hackerrank.com
2 Upvotes

r/competitivprogramming • • Jun 21 '20

can someone explain the logic

Post image
4 Upvotes

r/competitivprogramming • • Feb 23 '20

This 0.11 sec difference is what i'll even sell my soul for!

Post image
12 Upvotes

r/competitivprogramming • • Apr 23 '20

What are some good CP Books?

4 Upvotes

Can someone suggest some good competitive programming books ( Russian books most preferable if English translation is available ) that describes how to solve complex problems using mathematics


r/competitivprogramming • • Apr 13 '20

I created a discord to discuss codeforces DIV 2 problems. Join in

Thumbnail
discord.gg
3 Upvotes

r/competitivprogramming • • Apr 04 '20

CodeJam Parenting Partnering Returns

3 Upvotes

https://pastebin.com/Mw0cLqiA

Can anyone find whats wrong in this? Every test case i can think of is giving correct output yet WA .


r/competitivprogramming • • May 11 '20

codeforces problem

3 Upvotes

r/competitivprogramming • • May 04 '20

colour stripe

3 Upvotes

can someone explain the logic and recursion behind this question

https://codeforces.com/problemset/problem/219/C


r/competitivprogramming • • May 03 '20

Want to find if elements of an array can be summed to give a specific sum.

3 Upvotes

Given an array A I want to find if i can add any elements of it to get a sum S


r/competitivprogramming • • Jun 16 '20

Laaksonen's Guide to Competitive Programming is currently free by the publisher!

Thumbnail
link.springer.com
9 Upvotes

r/competitivprogramming • • May 22 '20

Another Problem

3 Upvotes

Please tell me how to approach the problem

https://codeforces.com/contest/1060/problem/C

I used prefix sum like dp and then binary search but somewhere arrays are going out of bounds

https://codeforces.com/contest/1060/submission/80916230

my solution


r/competitivprogramming • • Apr 07 '20

I made a list of content to study for competitive programming

15 Upvotes

[Studying competitive programming](Studying Competitive Programming https://www.linkedin.com/pulse/studying-competitive-programming-d%C3%A9bora-d-angelo-r-araujo).

It maybe has some English grammar mistakes. Any suggestion, please, comment it.

I hope it will be useful.


r/competitivprogramming • • May 03 '20

Squash the bugs codechef

1 Upvotes

I am facing problem in this question. How can I approach this problem.

http://www.codechef.com/problems/B5

Any method. I need some explanation. ๐Ÿ˜…


r/competitivprogramming • • Jan 04 '20

Any resources to learn competitive programming for free

4 Upvotes

Are there any resources such as books or online courses which provide indepth knowledge about game theory, DP?


r/competitivprogramming • • Apr 04 '20

Code jam Problem 3

3 Upvotes

I am giving google codejam .

I solved the first two questions and implemented the third question. It has also passed the sample test cases but on submitting giving WA.

link to the problem : https://codingcompetitions.withgoogle.com/codejam/round/000000000019fd27/000000000020bdf9

My solution :

https://pastebin.com/iHC5zp7F

Can anyone point out the mistake ??


r/competitivprogramming • • May 26 '20

Can someone explain how to do this using DP

Post image
6 Upvotes

r/competitivprogramming • • Dec 24 '19

EMaxx for Java

1 Upvotes

Hope you Might Know about Emaxx https://cp-algorithms.com/ in C++ for Learning Algo for Competitive Programming. I am working on a Project to Build Emaxx for Java. So our Java Community can do better at CP. People Like Petr, Egor, Akshay Miterani, Gaurav Sen, Summet Kumar did and become cp legend in Java. We need to provide good resources for people to Adapt Java More in CP. Kindly Reply to this comment. I will be Sharing a Discord link to Join.

Lets Make Java Great Again.


r/competitivprogramming • • Sep 29 '19

competitivprogramming has been created

2 Upvotes

A community for competitive programming. Ask for help, post memes, and enjoy!


r/competitivprogramming • • Apr 09 '20

All the solutions to the competitive programming course's problems by Coding ninjas๐ŸŒŸ:

Thumbnail
github.com
5 Upvotes