Hey there!, its been quite for a while, hasn't it?. well i got something, So my Professor gave me a Problem to solve Today, i thought you might find it interesting too, my solution is in C++, yours can be in any language, tell everyone in the comment, if you find another solution. The Problem … Continue reading [c++][Problems] Window Problem
Category: CodeChef Problems
The few Codechef Problem that i tried.
[C++] Parenthesis checker [Code_Problem]
PROBLEM : Given an expression string exp. Examine whether the pairs and the orders of “{“,”}”,”(“,”)”,”[“,”]” are correct in exp. For example, the program should print 'balanced' for exp = “[()]{}{[()()]()}” and 'not balanced' for exp = “[(])” Input: The first line of input contains an integer T denoting the number of test cases. Each … Continue reading [C++] Parenthesis checker [Code_Problem]
[CodeChef Problem] Beautiful Arrays Problem Code: ICPC16B
#include<iostream> using namespace std; int main() { int i,t=0; int T,n; cin>>T; string result[T]; do{ int zero=0,one=0,min_one=0,other_num=0; cin>>n; int a[n]; for(i=0;i<n;i++) { cin >> a[i]; if(a[i]==1) one++; else if(a[i]==0) zero++; else if(a[i]==-1) min_one++; else other_num++; } result[t] = ((other_num > 1) || (min_one > 1 && one == 0) || (min_one > 0 && other_num … Continue reading [CodeChef Problem] Beautiful Arrays Problem Code: ICPC16B
[CodeChef Problem] Snake Procession
The annual snake festival is upon us, and all the snakes of the kingdom have gathered to participate in the procession. Chef has been tasked with reporting on the procession, and for this he decides to first keep track of all the snakes. When he sees a snake first, it'll be its Head, and hence he will mark a 'H'. The snakes are long, and when he sees the snake finally slither away, he'll mark a 'T' to denote its tail. In the time in between, when the snake is moving past him, or the time between one snake and the next snake, he marks with '.' s.
