Search found 22 matches

Fri Aug 23, 2013 3:45 pm
Forum: Volume 110 (11000-11099)
Topic: 11031 - Looking for a Subset
Replies: 24
Views: 17187

11031 - Looking for a Subset

mf's output is not correct according to my accepted output.
Wed Aug 21, 2013 2:13 pm
Forum: Volume 115 (11500-11599)
Topic: 11553 - Grid Game
Replies: 10
Views: 3138

Re: 11553-Grid Game

Brute-force approach can run well within time limit. You need to consider all permutation of columns only. Because Bob will choose columns. We do not need to consider permutation of rows. Ultimately Alice have to cut all rows and how Bob will cut columns is the main question. Alice's order of row cu...
Wed Aug 21, 2013 2:11 pm
Forum: Volume 115 (11500-11599)
Topic: 11553 - Grid Game
Replies: 10
Views: 3138

11553 - Grid Game

Brute-force approach can run well within time limit. You need to consider all permutation of columns only. Because Bob will choose columns. We do not need to consider permutation of rows. Ultimately Alice have to cut all rows and how Bob will cut columns is the main question. Alice's order of row cu...
Mon Jan 21, 2013 1:13 pm
Forum: Volume 102 (10200-10299)
Topic: 10252 - Common Permutation
Replies: 150
Views: 50838

Re: 10252 - Common Permutation

Sample input: aasgfndfdsndsbfngferdsfnshhgbshehbnbniavnnbroaegbwaibhubdskeienvbffnhrr ufiuewgbvsusiuvnjakaslcvnirghbnvlodsjdvsbbfsoohbvrrbvdsdfsvdsundvssaamsmdn My accepted program returns: aaaabbbbbbbbdddddeeeffffffggghhhhiiiknnnnnnnnnorrrsssssssuvvw Your program returns: aaaabbbbbbdddddefffgghhiii...
Thu Nov 29, 2012 1:10 pm
Forum: Volume 113 (11300-11399)
Topic: 11341 - Term Strategy
Replies: 20
Views: 7708

11341 - Term Strategy(Clarification)

I think there is no test case where all grade value are less than 5 for a particular case.

So i think this input is invalid

Code: Select all

``````1
2 2
9 10
1 2
``````
I got accepted by considering the fact that at least one grade value is greater than or equal to 5 for a particular course.

BUET,CSE-07
Thu Oct 25, 2012 4:37 pm
Forum: Volume 3 (300-399)
Topic: 307 - Sticks
Replies: 56
Views: 17410

307 Sticks

what is the max value of n(number of parts of all sticks)?
Thu Aug 30, 2012 12:13 pm
Forum: Volume 121 (12100-12199)
Topic: 12172 - Matchsticks
Replies: 1
Views: 2310

12172 - Matchsticks

What are the outputs for the following inputs? First number is number of test cases.

Code: Select all

``````10
12
19
35
47
25
23
17
37
100
90
``````
Sun Aug 19, 2012 4:02 pm
Forum: Volume 113 (11300-11399)
Topic: 11375 - Matches
Replies: 18
Views: 6818

11375 - Matches

I have used the following dp, dp[n][0]->number of all numbers that can be formed by less than n matches dp[n][1] -> number of all numbers that can be formed by using exactly n matches dp[n][0] = dp[n-1][0] + dp[n-1][1] dp[n][1] = dp[n-2][1] + dp[n-3][1] + dp[n-4][1] + 3*dp[n-5][1] + 2*dp[n-6] + dp[n...
Sat Jun 02, 2012 6:24 pm
Forum: Volume 110 (11000-11099)
Topic: 11063 - B2-Sequence
Replies: 73
Views: 39652

11063 - B2-Sequence

for each (i,j) with i<=j ,I have saved value +value[j] in a set, not multiset. In multiset,same data can be presented more than one. If there is no duplicate of value +value[j] for different pairs(i,j) with (i<=j). then no. of elements in the set would be (n*(n-1))/2 + n = (n*n-n)/2 Otherwise it is ...
Sat Apr 28, 2012 7:55 am
Forum: Volume 101 (10100-10199)
Topic: 10178 - Count the Faces.
Replies: 12
Views: 4727

10178 - Count the Faces

The original graph may have many components. Let there are k components. Let the total number of faces is F. Initially F = 0 In input edges we can have- x x for each occurrence of such edges, just F++ Again we can have (x y) or (y x) If we get total p occurrences of (x y) or (y x) F = F+(p-1) Withou...
Sun Jul 03, 2011 12:19 am
Forum: Volume 114 (11400-11499)
Topic: 11404 - Palindromic Subsequence
Replies: 25
Views: 13731

11404 - Palindromic Subsequence

#include<iostream> #include<string> #include<cstring> #include<sstream> #include<algorithm> #include<cstdio> using namespace std; #define MAX 10005 char com1[10005]; char com2[10005]; int ind1,ind2; int m,n; int coun; int i,j,c[MAX][MAX],b[MAX][MAX]; int len; int LCSlength() { m=len; n=len; for (i=...
Thu Mar 24, 2011 3:30 am
Forum: Volume 5 (500-599)
Topic: 567 - Risk
Replies: 46
Views: 16488

567 (Risk) - WA

what's the problem in this code? #include<iostream> #include<vector> #include<cstring> #include<queue> #include<cstdio> using namespace std; #define un 0 #define dis 1 #define comp 2; vector<int>adj[25]; queue<int> q; int step; int state[25]; bool flag[25]; int in_queue[25]; int p[25]; int src,dest;...
Sun Jan 09, 2011 11:26 am
Forum: Volume 106 (10600-10699)
Topic: 10650 - Determinate Prime
Replies: 67
Views: 24334

10650(Determinate prime)

what is the bug in the code. #include<iostream> #include<vector> using namespace std; #define M 32009 vector<int> primeList,v; bool prime[100009]; void sieve() { int i,j,k,l,m; prime[0] = false; prime[1] = false; for(i = 4; i<= M; i += 2) { prime[i] = false; } for(i = 3; i <= M; i += 2) { if(prime[i...
Sun Jan 09, 2011 11:21 am
Forum: Volume 8 (800-899)
Topic: 871 - Counting Cells in a Blob
Replies: 27
Views: 14536

Re: 871 - Counting Cells in a Blob

I have found my fault. Input should be like square. So by calculating length of the first string , we can know how many rows will be followed. Then these two line have to use.
if(t > 0)
getchar();
Fri Jan 07, 2011 3:10 pm
Forum: Volume 8 (800-899)
Topic: 871 - Counting Cells in a Blob
Replies: 27
Views: 14536

871 - Counting Cells in a Blob

what's the reason of wrong answer? #include<iostream> #include<vector> #include<cstring> using namespace std; #define SIZE 101 vector <int> adj[SIZE][SIZE]; vector <int> adj1[SIZE][SIZE]; bool visited[SIZE][SIZE]; int v; char in[100][101]; int cnt; void visit(int u,int v) { int i; visited[u][v]=true...