Never hate what you do
Never do what you hate
Today may not be a bad day for you
But cruel are the hands of fate
Showing posts with label Memorables. Show all posts
Showing posts with label Memorables. Show all posts
Saturday, October 22, 2011
Alhamdulillah
Maybe I didn't get what I wanted.
Maybe I won't reach what I want from the deepest corner of my heart.
Maybe I'm born to just dream.
Maybe life was never what it seemed.
Maybe I was never to be a leader.
Maybe I'm only to follow others.
But, my friend. God has gifted me with the sweet experiences of loving what He has created.
Of knowing how to want His creation.
How to love His craft.
How to beg for more.
How to keep going back to Him after dreams shatter in front of me.
Alhamdulillah, for each and every moment. Couldn't be any better.
Maybe I won't reach what I want from the deepest corner of my heart.
Maybe I'm born to just dream.
Maybe life was never what it seemed.
Maybe I was never to be a leader.
Maybe I'm only to follow others.
But, my friend. God has gifted me with the sweet experiences of loving what He has created.
Of knowing how to want His creation.
How to love His craft.
How to beg for more.
How to keep going back to Him after dreams shatter in front of me.
Alhamdulillah, for each and every moment. Couldn't be any better.
[UVa] 11850 - Alaska
With this, I finish 300 solves in UVa. :) Took too long.
My stats at the moment:
Method:
1. Take the input and sort the array.
2. Check if between two consecutive stations the distance is > 200. If so IMPOSSIBLE
3. At last she has to go to the destination and come back to the last station, so check if (1422-[last station])X2 > 200.
My stats at the moment:
Submissions: 1701 Problems tried: 322 Problems solved: 300 First submission: 2009-11-17 Last submission: 2011-10-21
And details on the last submission: Problem number: 11850 Rank of solution: 225 Submission number: 9395891 Date: 2011-10-21 Time: 20:54:39 Runtime: 0.008
Method:
1. Take the input and sort the array.
2. Check if between two consecutive stations the distance is > 200. If so IMPOSSIBLE
3. At last she has to go to the destination and come back to the last station, so check if (1422-[last station])X2 > 200.
#include <stdio.h>
#include <stdlib.h>
int cmp(const void *a, const void *b)
{
return (*(int*)a - *(int*)b);
}
int miles[4000];
int main()
{
int n, i, set;
while (scanf("%d",&n) && n)
{
for (i=0 ; i<n ; i++)
scanf("%d",&miles[i]);
qsort(miles,n,sizeof(int),cmp);
set=1;
for (i=1 ; i<n && set ; i++)
{
if (miles[i]-miles[i-1]>200) set=0;
}
if (2*(1422-miles[n-1])>200) set=0;
if (set) printf("POSSIBLE\n");
else printf("IMPOSSIBLE\n");
}
return 0;
}
Subscribe to:
Posts (Atom)
Connect Rapoo MT750S with Linux (Tested on Manjaro)
I bought this obvious copy of MX Master 2S in hopes of having the device switching functionality along with a lightweight body because I ha...
-
I like coding a lot, keeps me glued to the PC for hours. For that reason it's a need to edit the Syntax Highlighter to suit my eyes for...
-
Method: The problem at first glance seems too straightforward but it's not that much. Think a bit about the lines "Erin can add ...
-
I bought this obvious copy of MX Master 2S in hopes of having the device switching functionality along with a lightweight body because I ha...