Search found 3 matches

by dreign
Tue Jul 02, 2013 11:11 pm
Forum: Volume 101 (10100-10199)
Topic: 10189 - Minesweeper
Replies: 418
Views: 124977

Re: 10189 - Minesweeper

thank you .
by dreign
Tue Jul 02, 2013 9:19 pm
Forum: Volume 101 (10100-10199)
Topic: 10189 - Minesweeper
Replies: 418
Views: 124977

Re: 10189 - Minesweeper

I don't know why I am getting WA .
My code works for all the test cases and my own test cases as well .
someone please help.

#include<iostream>
void update(int i,int j,int m, int n,char A[][100],int flag)
{
if(flag==1)
{
if((i-1)>=0)
{
if((j-1)>=0)
{
if(A[i-1][j-1]!='\0' && A[i-1][j-1 ...
by dreign
Tue Jul 02, 2013 4:41 pm
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 318352

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

Can anyone help me with optimization ,I keep getting time limited exceeded?
my code is below :

#include<stdio.h>
long A[1000001];
long barr(long n)
{
if(n==1)
return 1;

if (n<1000001)
{
if (A[n]!=0)
return (A[n]);
else
{
long k;
k=n%2 ? (3*n+1) : n/2 ;
A[n]=1+barr(k);
return(A[n]);
}
}
else ...

Go to advanced search