Search found 11 matches

by farnaws123
Fri Dec 21, 2012 8:12 pm
Forum: Volume 1 (100-199)
Topic: 102 - Ecological Bin Packing
Replies: 485
Views: 33393

Getting TL for UVa 102

I am not sure why am I getting TL for the following code? #include<iostream> #include<string> /*eco_bin_packing,MinDFrEak,20122012*/ using namespace std; int eco_bin_pack() { string color_combin[6]={"BCG","BGC","CBG","CGB","GBC","GCB"}; int bottles_nos[3][3]={0}; int row=0,col=0; cin>>bottles_nos[0]...
by farnaws123
Fri Dec 21, 2012 6:24 am
Forum: Volume 1 (100-199)
Topic: 102 - Ecological Bin Packing
Replies: 485
Views: 33393

Re: 102 Runtime Error (SIGSEGV)

What could be the possible reason to get RE? #include<iostream> #include<string> #include <vector> #include <sstream> #include <cctype> #include <cstdlib> /*eco_bin_packing,MinDFrEak,20122012*/ using namespace std; int eco_bin_pack(string str) { string array[6]={"BCG","BGC","CBG","CGB","GBC","GCB"};...
by farnaws123
Wed Dec 19, 2012 11:35 pm
Forum: Volume 1 (100-199)
Topic: 102 - Ecological Bin Packing
Replies: 485
Views: 33393

Re: Problem 102 WA !

#include<iostream> #include<string> #include <vector> #include <sstream> #include <algorithm> /*Problem ID:102, MindFreak, 19/12/2012*/ using namespace std; int swap(string &str_array,int i,int j) { char str=str_array[j]; str_array[j]=str_array[i]; str_array[i]=str; return 0; } int main() { string ...
by farnaws123
Sat Dec 15, 2012 4:17 am
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 180027

Re: If you get WA in problem 100, read me before post!

now getting WA..:/
by farnaws123
Fri Dec 14, 2012 6:44 am
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 180027

Re: If you get WA in problem 100, read me before post!

/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package sample_java; /** * * @author Nawshad * Problem: 100 */ // import java.io.IOException; import java.util.StringTokenizer; class Main { static String ReadLn (int maxLg) // utility function to read ...
by farnaws123
Fri Dec 14, 2012 5:33 am
Forum: Volume 104 (10400-10499)
Topic: 10487 - Closest Sums
Replies: 89
Views: 29668

Re: 10487 - Closest Sums

you're great! Thank you, it worked!!!!!!!=))
by farnaws123
Thu Dec 13, 2012 2:00 am
Forum: Volume 104 (10400-10499)
Topic: 10487 - Closest Sums
Replies: 89
Views: 29668

Re: 10487 - Closest Sums

#include<iostream> #include<cstdio> using namespace std; /*farnaws,10487,C++*/ int main() { int n=0, numbers[1005],m=0,queries[30],temp=0,sum_array_length=0,test_case=0; while(1) { cin>>n; getchar(); if(n>1 && n<=1000) { temp=n; sum_array_length=0; for(int i=0; i<n; i++) { cin>>numbers[i]; sum_arra...
by farnaws123
Tue Dec 11, 2012 4:03 am
Forum: Volume 6 (600-699)
Topic: 673 - Parentheses Balance
Replies: 243
Views: 45045

Re: 673 WA, whats wrong??

Worked!!!
by farnaws123
Mon Dec 10, 2012 8:12 pm
Forum: Volume 6 (600-699)
Topic: 673 - Parentheses Balance
Replies: 243
Views: 45045

Re: 673 WA, whats wrong??

#include<iostream> #include<stack> #include<string> #include<cstdio> /*farnaws,C++,673,08/12/2012*/ using namespace std; string verifier(string input_line) { stack <char> braces; int flag=0, count_left_first_brace=0,count_left_third_brace=0; for(int i=0; i<input_line.size(); i++) { if(input_line[i]...
by farnaws123
Mon Dec 10, 2012 12:15 am
Forum: Volume 6 (600-699)
Topic: 673 - Parentheses Balance
Replies: 243
Views: 45045

673 WA, whats wrong??

#include<iostream> #include<stack> #include<vector> #include<string> #include<fstream> #include<cstdlib> /*farnaws,C++,673,08/12/2012*/ using namespace std; string verifier(string input_line) { stack <char> braces; int flag=0, count_left_first_brace=0,count_left_third_brace=0; cout<<"input size:"<<...
by farnaws123
Mon Dec 10, 2012 12:03 am
Forum: Volume 6 (600-699)
Topic: 673 - Parentheses Balance
Replies: 243
Views: 45045

Re: 673 WA!!

#include<iostream> #include<stack> #include<vector> #include<string> #include<fstream> #include<cstdlib> /*farnaws,C++,673,08/12/2012*/ using namespace std; string verifier(string input_line) { stack <char> braces; int flag=0,count_left_first_brace=0,count_left_third_brace=0; for(int i=0; i<input_l...

Go to advanced search