Showing posts with label this. Show all posts
Showing posts with label this. Show all posts

Monday, December 26, 2016

UVa 343 What base is this

UVa 343 What base is this


I was too lazy when I saw this problem for the very first time 2 years ago. Solving problems that required parsing a string were too tedious for me back then. Well, guess what it generated a great code for future problems from this domain.

#include <stdio.h>
#include <math.h>
#include <string.h>
#define isChar(i) ((i>=A&&i<=Z)||(i>=0&&i<=9))
typedef unsigned long long ULL;
int vals[1000];
char input[1000], val1[1000], val2[1000];
ULL getVal(char *a, int base, int ln)
{
int len = ln, i;
ULL val=0;
for (i=len-1 ; i>=0 ; i--)
{
val = val + (vals[a[i]]) * (int)pow((double)base,(len-1-i));
}
return val;
}

int setVals()
{
int i;
for (i=0 ; i<=9 ; i++)
{
vals[i+0] = i;
}
for (i=A ; i<=Z ; i++)
{
vals[i] = (i-55);
}
}

int parser(char *a, int *l1, int *l2, int *mb1, int *mb2)
{
int i, j, min;
for (i=0 ; !isChar(a[i]) ; i++);
min=-1;
for (j=0 ; isChar(a[i]) ; i++, j++)
{
val1[j]=a[i];
if (vals[a[i]]>min)
min = vals[a[i]];
}
val1[j]=;
*l1=j;
*mb1=min+1;

for ( ; !isChar(a[i]) ; i++);
min=-1;
for (j=0 ; isChar(a[i]) ; i++, j++)
{
val2[j]=a[i];
if (vals[a[i]]>min)
min = vals[a[i]];
}
val2[j]=;
*l2=j;
*mb2=min+1;
}

int main()
{
int l1, l2, minb1, minb2, f, i, j;
setVals();

while (gets(input))
{
parser(input,&l1,&l2,&minb1,&minb2);

f=0;

for (i=(minb1>1?minb1:2) ; i<=36 && !f ; i++)
{
for (j=(minb2>1?minb2:2) ; j<=36 && !f ; j++)
{
if (getVal(val1,i,l1) == getVal(val2,j,l2))
{
printf("%s (base %d) = %s (base %d) ",val1,i,val2,j);
f=1;
}
}
}

if (!f) printf("%s is not equal to %s in any base 2..36 ",val1,val2);

}
return 0;
}


Go to link download

Read more »

Tuesday, November 1, 2016

Galaxy S4 Galaxy S3 and Galaxy Note 2 will be updated to Android 4 3 later this year

Galaxy S4 Galaxy S3 and Galaxy Note 2 will be updated to Android 4 3 later this year


Samsung did not specify Galaxy S4, Galaxy S3 and Galaxy Note 2 will be updated to Android 4.3 but said the plant will be connected to the clock Galaxy Gear later this year. Galaxy Gear currently only support Note 3 and Note 2 10.1 2014 version required to run on Android 4.3 machine to connect using Bluetooth Low Energy is energy saving. According to Mr. Lee Don-joo, General Manager of Strategic Marketing Samsung says Galaxy S4 will support Gear on October S3 and Note 2 is also the end of November, so maybe this is the time the machine is also updated to 4.3. This information is completely coincides with previous rumors that S4 will be up to 4.3 in September or October this year.
Galaxy S4, Galaxy S3 and Galaxy Note 2 will be updated to Android 4.3 later this year
Yesterday while attending the premiere Galaxy Note3 and Galaxy Gear in the city Ho Chi Minh, representing Samsung also said in the future they will update the above models to be compatible with Galaxy Gear should be able to update the time is not far again.
According AndroidAuthority

Go to link download

Read more »

Friday, October 28, 2016

UVa LIVE 4493 This is your queue

UVa LIVE 4493 This is your queue


#include <set>
#include <map>
#include <list>
#include <cmath>
#include <ctime>
#include <deque>
#include <queue>
#include <stack>
#include <cctype>
#include <cstdio>
#include <string>
#include <vector>
#include <cassert>
#include <cstdlib>
#include <cstring>
#include <sstream>
#include <iostream>
#include <algorithm>

using namespace std;

deque<int> M;
stack<int> Q;
int main()
{
int P, C, i, SER, print, m, t, kase=1;
char CHR[10];
while (scanf("%d %d",&P,&C)==2)
{
if (!P && !C)
break;
printf("Case %d: ",kase++);


//getchar();
//cout << "---> " << endl;
M.clear();
m = min(P,1000);
for (i=1 ; i<=m ; i++)
{
M.push_back(i);
}
for (i=1 ; i<=C ; i++)
{
t = scanf("%s",CHR);

if (!strcmp(CHR,"N"))
{
print = M.front();
M.pop_front();
printf("%d ",print);
M.push_back(print);
} else if (!strcmp(CHR,"E"))
{
scanf("%d",&SER);
while (!Q.empty()) Q.pop();
//cout << "------------------------" << endl;
//printf("-> %d ",SER);
while (!M.empty() && M.front() != SER)
{
//cout << M.front() << endl;
Q.push(M.front());
M.pop_front();
}
if(!M.empty()) M.pop_front();
//cout << "------------------------" << endl;
while (!Q.empty())
{
M.push_front(Q.top());
Q.pop();
}
M.push_front(SER);
}
}
}
return 0;
}


Go to link download

Read more »

Monday, October 17, 2016

Gotta check this out

Gotta check this out


For LINUX-ANDROID WLAN

Go to link download

Read more »

Wednesday, September 21, 2016

HTC One version Developer Android 4 3 update this week

HTC One version Developer Android 4 3 update this week


Jason Mackenzie, President of HTC America region has announced on his Twitter that the HTC One Phone Developer Edition version (already open bootloader) will be updated to Android 4.3 this week, while the HTC One common machine 4.3 will be up before the end of September, but only applies to machines in Canada. Canadian carrier Rogers also confirmed the information will have the 4.3 update by the end of September, while the other is a carrier TELUS is said to have an update in early October.
HTC One version Developer Android 4.3 update this week

HTC One version Developer Android 4.3 update this week

Go to link download

Read more »

Friday, September 9, 2016

This will get your dick ROCK HARD

This will get your dick ROCK HARD


However, if your sex life is suffering from ED, as mine was, you should keep reading .

Hey everyone, my name is Jason Long. I’m 56 years old and here is my story. Even though I love my wife and find her incredibly fucking hot , I was simply not able to fulfill her needs in the bedroom. It made her feel ugly and undesirable... and it made me feel like less of a man. The worst thing about all this is that I did not understand my problem . Why was this happening? All through my twenties and thirties I never had a problem getting it up. In fact, my only problem was controlling my raging boners . I could go all night without breaking a sweat and make the ladies cum once, twice and even three times, easily. I never thought it would come to this, but it has. As desperate as I was, I had no choice but to try pills like Viagra, Levitra and others. It helped a bit at first, yeah, but then I started getting some fucked up side effects, such as diarrhea and nausea. Ugh.

To add insult to injury, Viagra is simply not a cure for ED . All it does is offer a temporary solution to a serious problem : desensitization . Plus, those drugs are not only dangerous, but very expensive . I needed to find the root of the problem. Imagine how happy I was when I found out there were professional researchers out there searching for a solution, just like me. Pharmaceutical companies don’t want you to know this, but there’s a simple method that cures ED and fixes desensitization, forever. You can imagine how pumped I was when I finally proved it to myself that the method actually works . That night I fucked my wife so hard the next day she could barely walk!

I called up my best friend who also suffered from ED and told him what I had tried . At first he was sceptical, and rightfully so. I wouldn’t have believed it either. Even though he was too embarrassed to come out and say it, I knew he needed this as much as I did. Surprise, it worked for him too ! He then told some of his buddies and pretty soon I had a small group of followers who worshipped me because I helped put the sex back in their sex life. I figured I could help a lot of men with this method , so I decided to put together a short video that would show guys how to revive their limp dicks. Imagine how thrilled they were to find out it’s not only totally FREE, but also safe and you could do it from home!

Don’t wait, check out this video . Find out what thousands of men have been raving about. A scientifically tested formula that will cure your ED once and for all.

Stop worrying about not being able to get it up. Stop lying to your wife or girlfriend. Stop stressing over another frustrating night of unfulfilled lust. Start banging her brains out! You will feel proud again... and she will thank you for it.

Go to link download

Read more »