Getting tle.
Can anyone give some idea to minimise time?
#include<iostream>
#include<algorithm>
#include<queue>
#include<stack>
#include<sstream>
#include<vector>
#include<map>
#include<string>
using namespace std;
#include<stdio.h>
#include<string.h>
#include<math.h>
#include<stdlib.h>
#define ...
Search found 15 matches
- Thu Jan 26, 2012 1:34 pm
- Forum: Volume 116 (11600-11699)
- Topic: 11686 - Pick up sticks
- Replies: 44
- Views: 17158
- Sun Jan 30, 2011 9:48 am
- Forum: Volume 3 (300-399)
- Topic: 361 - Cops and Robbers
- Replies: 50
- Views: 22320
Re: 361 Again!!!
Can I have the .exe of your AC code for 361.I am getting WA in this problem also.
Or,please tell me what is the critical test case for which I should concerned.
Or,please have a look on my code.
#include<stdio.h>
#include<math.h>
#include<string.h>
#include<iostream>
#include<queue>
#include ...
Or,please tell me what is the critical test case for which I should concerned.
Or,please have a look on my code.
#include<stdio.h>
#include<math.h>
#include<string.h>
#include<iostream>
#include<queue>
#include ...
- Tue Jan 25, 2011 9:52 am
- Forum: Volume 6 (600-699)
- Topic: 640 - Self Numbers
- Replies: 47
- Views: 25878
Re: 640 - Self Numbers
I solved it. Its a easy problem. I have used an array a.
for i=0 tp i=1000000
a=0
for i=0 tp i=1000000
i+=sumofdigit(i)
a=1
then i just print indexes whose value is 0.
thets it.
for i=0 tp i=1000000
a=0
for i=0 tp i=1000000
i+=sumofdigit(i)
a=1
then i just print indexes whose value is 0.
thets it.
- Sun Jan 23, 2011 8:52 am
- Forum: Volume 6 (600-699)
- Topic: 673 - Parentheses Balance
- Replies: 243
- Views: 79366
Re: 673 - Parentheses Balance
I don't know where is my problem.I m getting WA in this problem. I have used stack to solve this problem.
Thanks in advanced.
EDIT: I got AC.It was a silly mistake.
Thanks in advanced.
EDIT: I got AC.It was a silly mistake.
- Fri Jan 14, 2011 6:49 pm
- Forum: Volume 103 (10300-10399)
- Topic: 10316 - Airline Hub
- Replies: 25
- Views: 10123
Re: 10316 - Airline Hub
On my last code after using !=EOF i got Wrong answer.Anyone,please help me.
- Fri Jan 14, 2011 6:45 pm
- Forum: Volume 103 (10300-10399)
- Topic: 10316 - Airline Hub
- Replies: 25
- Views: 10123
Re: 10316 - Airline Hub
I am getting TLE on this problem.Can anyone help me to improve running time????
Thanks in advance..
////10316 Airlines HUB//////
#include<stdio.h>
#include<string.h>
#include<math.h>
#define MAXN 1002
#define RADIO 6378.0
#define INF 2147483647
double PIx=3.141592653589793;
int n;
long ...
Thanks in advance..
////10316 Airlines HUB//////
#include<stdio.h>
#include<string.h>
#include<math.h>
#define MAXN 1002
#define RADIO 6378.0
#define INF 2147483647
double PIx=3.141592653589793;
int n;
long ...
- Mon Nov 29, 2010 8:06 am
- Forum: Volume 118 (11800-11899)
- Topic: 11800 - Determine the Shape
- Replies: 47
- Views: 21877
Re: UVA 11800 gettting RE
Hey guys,I have avoided RE.Now getting TLE.
For what,I don't know...please help me....
///////Determine the shape 11800 //////////////////
#include <stdio.h>
#include <math.h>
#include <iostream>
#include <algorithm>
using namespace std;
#define PI 3.141592653589793;
const int MAXN=5;
typedef ...
For what,I don't know...please help me....
///////Determine the shape 11800 //////////////////
#include <stdio.h>
#include <math.h>
#include <iostream>
#include <algorithm>
using namespace std;
#define PI 3.141592653589793;
const int MAXN=5;
typedef ...
- Sat Nov 27, 2010 6:56 am
- Forum: Volume 118 (11800-11899)
- Topic: 11800 - Determine the Shape
- Replies: 47
- Views: 21877
UVA 11800 gettting RE
Hello guys..I am getting RE on 11800.I can't find out the problem.
Actually I have used convex hull to sort the point.
got RE.
Again,I have used another method using the maximum angle of rectangles and Got AC.
why not convex hull???
Here is my RE code.Please check this.
/////////////convex hull ...
Actually I have used convex hull to sort the point.
got RE.
Again,I have used another method using the maximum angle of rectangles and Got AC.
why not convex hull???
Here is my RE code.Please check this.
/////////////convex hull ...
- Thu Nov 11, 2010 1:04 pm
- Forum: Volume 4 (400-499)
- Topic: 453 - Intersecting Circles
- Replies: 84
- Views: 29075
Re: 453 argghhh
I got AC on this problem.
check this test case given below.U will get AC also...
check this test case given below.U will get AC also...
Code: Select all
1.0 1.0 5.0
1.0 1.0 5.0
1.0 1.0 0.0
1.0 1.0 0.0
5.2 2.5 0.0
6.1 8.2 0.0
- Thu Nov 11, 2010 10:00 am
- Forum: Volume 4 (400-499)
- Topic: 453 - Intersecting Circles
- Replies: 84
- Views: 29075
Re: 453
gootsa,please check this testcase..
please ,send your new code to me,if you dont mind....
usuttra@yahoo.com
Code: Select all
input
1.0 1.0 5.0
1.0 1.0 10.0
output must be
(1.000,1.000)
usuttra@yahoo.com
- Tue Oct 19, 2010 7:12 am
- Forum: Volume 4 (400-499)
- Topic: 496 - Simply Subsets
- Replies: 48
- Views: 14711
496..getting TLE
Hey everyone,I have tried 496 and got TLE.Will you please check my code??And tell me how can I reduce execution time..
#include<stdio.h>
int main(){
int asb,bsa,i,j,k,a[50],b[50],l,p,q;
char c;
while(1){
asb=0;bsa=0;
for(i=0;;i++) {
scanf("%d%c",&a[i],&c);
if(c=='\n')
break;}
for(j=0;;j ...
#include<stdio.h>
int main(){
int asb,bsa,i,j,k,a[50],b[50],l,p,q;
char c;
while(1){
asb=0;bsa=0;
for(i=0;;i++) {
scanf("%d%c",&a[i],&c);
if(c=='\n')
break;}
for(j=0;;j ...
- Fri Sep 24, 2010 7:10 am
- Forum: Java
- Topic: JAVA-Difficulties We Face
- Replies: 31
- Views: 31394
Re: JAVA-Difficulties We Face
I have learned Java a little.Now I am trying to use Java for UVA.I have submitted 100 no.it is runtime error.I think ,it is for Scanner.You please help me take input from standard input ensuring EOF.My code is given below.
import java.io.*;
import java.util.*;
class Main {
static int cycle ...
import java.io.*;
import java.util.*;
class Main {
static int cycle ...
- Tue Sep 07, 2010 8:41 pm
- Forum: Volume 108 (10800-10899)
- Topic: 10862 - Connect the Cable Wires
- Replies: 14
- Views: 11030
Re: 10862 - Connect the Cable Wires
I am sorry to inturrupt.But I want to submit code in JAVA language.I have never done it.What is the basic difference to submit it?what will be the class name.
Let see....
public class Connect{
public static void main()
{
//main code goes here
}//end of main
}//end of class
Let see....
public class Connect{
public static void main()
{
//main code goes here
}//end of main
}//end of class
- Fri Sep 03, 2010 11:15 am
- Forum: Volume 4 (400-499)
- Topic: 483 - Word Scramble
- Replies: 122
- Views: 38848
Re: 483 Word Scramble PE!!!!!!!!!!!!!
Ok,ACCEPTED....
- Fri Sep 03, 2010 9:56 am
- Forum: Volume 4 (400-499)
- Topic: 483 - Word Scramble
- Replies: 122
- Views: 38848
Re: 483 Word Scramble WA
Please check my code.I am getting WA.
#include<stdio.h>
#include<string.h>
int main(){
char s[500];
int i,j,n,p;
while(gets(s)){
n=strlen(s);
j=0;
i=0;
for(i=0;i<n;i++){
if(s[i+1]=='\0') {
for(p=i;p>=j;p--)
printf("%c",s[p]);
printf("\n");
break;
}
else if(s[i+1]==' ')
{
for(p=i;p>=j;p ...
#include<stdio.h>
#include<string.h>
int main(){
char s[500];
int i,j,n,p;
while(gets(s)){
n=strlen(s);
j=0;
i=0;
for(i=0;i<n;i++){
if(s[i+1]=='\0') {
for(p=i;p>=j;p--)
printf("%c",s[p]);
printf("\n");
break;
}
else if(s[i+1]==' ')
{
for(p=i;p>=j;p ...