my method is O(n*log(n)) But Wrong answer.
any one can help me!
thank you!
[cpp]
#include<iostream.h>
#include<stdio.h>
#include<math.h>
#include<fstream.h>
ifstream in("es_10245.in");
//#define in cin
const double eps=1e-14;
struct point{
double x,y;
} p[10000];
int N;
void swap(int i,int j ...
Search found 3 matches
- Sun Aug 04, 2002 7:41 pm
- Forum: Volume 102 (10200-10299)
- Topic: 10245 - The Closest Pair Problem
- Replies: 92
- Views: 33519
- Fri Jul 26, 2002 7:52 am
- Forum: Volume 101 (10100-10199)
- Topic: 10170 - The Hotel with Infinite Rooms
- Replies: 20
- Views: 12406
10170 - The Hotel with Infinite Rooms
What is wrong with my program?
[cpp]
#include<iostream.h>
#include<math.h>
#include<stdio.h>
const double eps=1e-14;
double cal(double S,double D)
{
if(S>=D) return S;
double temp;
double k;
temp=floor(sqrt(2*D))+1;
for(k=temp;k>0;k--){
if(((2*S+k-1)*k<2*D)&&(2*D-(2*S+k)*(k+1)<eps)) return ...
[cpp]
#include<iostream.h>
#include<math.h>
#include<stdio.h>
const double eps=1e-14;
double cal(double S,double D)
{
if(S>=D) return S;
double temp;
double k;
temp=floor(sqrt(2*D))+1;
for(k=temp;k>0;k--){
if(((2*S+k-1)*k<2*D)&&(2*D-(2*S+k)*(k+1)<eps)) return ...
- Sat Jul 20, 2002 4:55 am
- Forum: Volume 100 (10000-10099)
- Topic: 10006 - Carmichael Numbers
- Replies: 66
- Views: 29531
10006 - Carmichael Numbers
I got wrong answer. Anyone can help me about this!
Thank you very much!
[cpp]
/*
#include<iostream.h>
#include<fstream.h>
ofstream out("es_10006.out");
int notprime[65000];
int prime[6505];
int num[100];
int cal(int a,int k,int n)
//return a^k(mod n)
{
int ans=a;
if(k==1) return a;
if(k%2 ...
Thank you very much!
[cpp]
/*
#include<iostream.h>
#include<fstream.h>
ofstream out("es_10006.out");
int notprime[65000];
int prime[6505];
int num[100];
int cal(int a,int k,int n)
//return a^k(mod n)
{
int ans=a;
if(k==1) return a;
if(k%2 ...