Search found 11 matches

by coder.tanvir
Tue Aug 11, 2015 12:21 am
Forum: Volume 6 (600-699)
Topic: 657 - The die is cast
Replies: 46
Views: 30343

Re: 657 - The die is cast


#include <bits/stdc++.h>
using namespace std;
char Grid[1000][1000];
int ans[100000];
int n , m , ANS;
int dx[]={1,-1,0,0,1,-1,1,-1};
int dy[]={0,0,-1,1,1,-1,-1,1};
bool Check(int i ,int j){
for(int a =0; a<4 ; a++){
if(Grid[i+dx[a]][j+dy[a]]=='_') return false;
}
return true;
}
void DFS(int i ...
by coder.tanvir
Tue Jul 28, 2015 2:18 am
Forum: Volume 109 (10900-10999)
Topic: 10910 - Marks Distribution
Replies: 26
Views: 17877

Re: 10910 - Marks Distribution

I have solved this problem using DP , but i cant figure out how it become Binomial coefficient.
by coder.tanvir
Wed Jul 22, 2015 3:10 am
Forum: Volume 12 (1200-1299)
Topic: 1213 - Sum of Different Primes
Replies: 1
Views: 2385

Re: 1213 - Sum of Different Primes

try to avoid memset :)
by coder.tanvir
Fri May 22, 2015 3:34 pm
Forum: Volume 120 (12000-12099)
Topic: 12043 - Divisors
Replies: 6
Views: 5111

Re: 12043 - Divisors

Check the case
input

Code: Select all

1
3 6 3
output

Code: Select all

6 16
by coder.tanvir
Tue May 12, 2015 10:43 pm
Forum: Volume 112 (11200-11299)
Topic: 11221 - Magic square palindromes.
Replies: 58
Views: 30426

Re: 11221 - Magic square palindromes.

#include <bits/stdc++.h>
int main()
{
char cas[10];
int ca , x=0;
gets(cas);
ca=atoi(cas);
while(ca--)
{
char line[10010];
char final_[10010];
char final_1[10010];
char final_2[10010];
char final_3[10010];
gets(line);
int len = strlen(line) ;
int j=0;

for(int i=0; i< len; i++)
if ...
by coder.tanvir
Sun Mar 22, 2015 4:48 pm
Forum: Volume 3 (300-399)
Topic: 332 - Rational Numbers from Repeating Fractions
Replies: 83
Views: 34195

Re: 332 - Rational Numbers from Repeating Fractions

i think working with double for this problem is so risky.
by coder.tanvir
Sat Mar 21, 2015 8:32 am
Forum: Volume 102 (10200-10299)
Topic: 10200 - Prime Time
Replies: 202
Views: 96674

Re: 10200 - Prime Time

after adding 1e+9, get accepted . why they dnt use special judge ? or why in ques they dnt mention that no special judge for this ques ?
by coder.tanvir
Fri Mar 20, 2015 11:30 pm
Forum: Volume 107 (10700-10799)
Topic: 10789 - Prime Frequency
Replies: 38
Views: 27515

Re:

input

10
oieurfndskjbnz000000157986216nvknMANC
idufjdklmvlkue342494832674921487
76583hjfkshgkiKJDNHFKJSkjsdnksi
iutioerniIHGFSDHuyeuiu735982347kkj
nnvnvnnv
a
0
A
0001AA
BBNAaaa9


Output

Case 1: 16k
Case 2: 234789dklu
Case 3: JKhijs
Case 4: 37Hek
Case 5: nv
Case 6: empty
Case 7: empty
Case 8 ...
by coder.tanvir
Fri Mar 20, 2015 10:34 pm
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 317826

Re: 100 - The 3n + 1 problem

write another function who can calculate the max length , then just call from main . dont know why this way reduce time , its work for me.
by coder.tanvir
Fri Mar 20, 2015 10:25 pm
Forum: Volume 105 (10500-10599)
Topic: 10522 - Height to Area
Replies: 32
Views: 21581

Re: 10522 - Height to Area

#include <stdio.h>
#define EPS 1e-18
int main()
{
int ca;
scanf("%d",&ca);
while(ca){
long double Ha,Hb,Hc,area;
scanf("%Lf %Lf %Lf",&Ha,&Hb,&Hc);
area=((Ha*Hb*Hc)/(Ha*Hc+Ha*Hb+Hb*Hc))*((Ha*Hb*Hc)/(Ha*Hc-Ha*Hb+Hb*Hc))*((Ha*Hb*Hc)/(Ha*Hc+Ha*Hb-Hb*Hc))*((Ha*Hb*Hc)/(-Ha*Hc+Ha*Hb+Hb*Hc));
if ...
by coder.tanvir
Fri Mar 20, 2015 8:33 am
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 317826

Re: 100 - The 3n + 1 problem

how to reduce the run time ?? i get accepted 0.690s

Go to advanced search