Category Archives: URI Online Judge

URI Online Judge | 1030 Flavious Josephus Legend

This is level 3 problem so will do it later. But this video will help for  sure.

 

URI Online Judge Solution | 1049 Animal

strcmp in c/c++ issues is the hard part nothing else…Just try to learn this 🙂
Logical condition based problem it was.

 

 

URI Online Judge Solution | 1048 Salary Increase

My failed code:
http://ideone.com/4o96LX

My succeeded accepted code:

 

URI Online Judge Solution | 1332 One-Two-Three | UVA 12289

Reference: https://github.com/deniscostadsc/playground/blob/master/uri/1332/1332.cpp
Code:

Editorial:

Here we have to think like a child :D….So first we took a character array where we will take input string.And if the input is = 5 then it will print three as per the input set.And then when we enter the value input like ‘t’ and ‘o’ and ‘w’ then we can make it out from the string.So we have added this like this if t and w or if t or o or w or o is available then we will print 2 in the output where in string array t in the position 1, w is in the position 2, o is in the position 3

So basically the output case 2 we made the condition in the logic.

Note: In logic we must have to follow the sequence of the text One,Two,Three as suppose in two it can be two,too,ooo,owo  and as the input will do at most 100 words.So this steps has been taken 🙂

URI Online Judge Solution| 1168 LED

Reference:
https://meavdluna.wordpress.com/2015/09/07/solucao-uri-1168-leds-c/

https://raw.githubusercontent.com/gmendonca/uri-problem-solutions/master/1168.cpp

https://github.com/deniscostadsc/playground/blob/master/uri/1168/1168.cpp

URI Online Judge | 1042 Simple Sort

https://www.urionlinejudge.com.br/judge/en/problems/view/1042

Here this links may help

http://www.mathsisfun.com/definitions/ascending-order.html
and
http://www.mathsteacher.com.au/year7/ch02_power/06_asc/asc.htm

URI Online Judge Solution | 1041 Coordinates of a Point

Here is the logic,  1041

If x!=0 and y==0 then it will be in the y asix and
If y!=0 and x==0 then it will be in the x axis

that means you have to understand if what the value is equivalent to 0 then it will be in that axis

And one thing = means assignment operator if x=y then if x=5 then y=5

and == means comparison operator if x==y then if x==4 and y==5 then x!=y so it will be false

and if x=5 and y=5 then x==y and it is true

Reference:
http://www.allinterview.com/showanswers/17960/what-is-the-difference-between-and-in-c.html
http://www.mathsisfun.com/data/cartesian-coordinates.html

code:

and like this can do

 

 

Here in this code you have to think about the flow which normally starts from the 0 and the compiler starts punctuating the code from Zero 0.

logic flow can be start from 0 then can be happen through greater than or equal

It’s better to do in C/C++ main format