IdeaMonk

thoughts, ideas, code and other things...

Saturday, July 05, 2008

Low hanging fruits

To busy with work, but SPOJ addiction hasn't yet died out completely. Only that BASE GOSSIPER and STPAR problems bugged me a lot. Still no solution for them. Who said spoj isn't good at surprises! Try sorting problem list with different parameters, you will find loads of engaging low hanging fruits. And one of them is TOANDFRO. Pretty easy with vectors in c++! Got me #1610 today. Have to find all such fruits. :-) Next stop... PALIN
#include <iostream>
#include <vector>
using namespace std;

main (){
string c;
int cols,sz,i,j,len,cindex,tsize;
vector<string> table;

scanf ("%d",&cols);
while (cols!=0){
cin>>c;
len=c.size();
sz=len/cols;
int toggle=0; string crow;

/* *************************************

Its really against the spirit
of sports to show solutions!
-anon.

**************************************** */
cindex=0; tsize=table.size();
for (j=0;j<cols;j++){
for (i=0;i<tsize;i++){
printf ("%c",table[i][cindex]);
}
cindex++;
}
printf ("\n");
table.clear();
scanf ("%d",&cols);
}
return 0;
}
// isn't this much enough ;P

Labels: ,

1 Comments:

At January 3, 2011 at 1:00 AM , Blogger Zobayer Hasan said...

haha, like the title :P

 

Post a Comment

Subscribe to Post Comments [Atom]

<< Home