I try to change my code. It produces RE(Signal 8)
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#define max 50000
long bil_prima[5133];
bool prime[max+1];
void prima()
{
int i,j,x=0;
int limit = (int) sqrt(max)+1;
for (i=1;i<=max;i++) prime[i] = i&1;
prime[0] = prime[1] = false ...
Search found 6 matches
- Fri Jun 08, 2007 10:26 am
- Forum: Volume 5 (500-599)
- Topic: 583 - Prime Factors
- Replies: 171
- Views: 61298
- Wed Jun 06, 2007 6:50 pm
- Forum: Volume 5 (500-599)
- Topic: 583 - Prime Factors
- Replies: 171
- Views: 61298
- Wed Jun 06, 2007 8:31 am
- Forum: Volume 5 (500-599)
- Topic: 583 - Prime Factors
- Replies: 171
- Views: 61298
- Wed Jun 06, 2007 5:50 am
- Forum: Volume 104 (10400-10499)
- Topic: 10469 - To Carry or not to Carry
- Replies: 24
- Views: 15816
Re: hiiiiiiiii
OMG, I wasted my time to convert a and b to binary number and XoR them. With my previous code, I got WA. But with only one line code, I got AC. Thank u very much.nikhil wrote:just print...
(a^b)
get accccccccccccccc
thx.
- Sun Jun 03, 2007 2:00 pm
- Forum: Volume 106 (10600-10699)
- Topic: 10696 - f91
- Replies: 21
- Views: 14721
Re: Why my program use so many memory?
Why my program use 440 :-? memory?(10696)
#include <iostream>
int main()
{
int n,k;
std::cin>>n;
while (n!=0)
{
if (n<=100) std::cout<<"f91("<<n<<") = "<<91<<std::endl;
else std::cout<<"f91("<<n<<") = "<<n-10<<std::endl;
std::cin>>n;
}
return 0;
}
Maybe that one will be better. My code ...
#include <iostream>
int main()
{
int n,k;
std::cin>>n;
while (n!=0)
{
if (n<=100) std::cout<<"f91("<<n<<") = "<<91<<std::endl;
else std::cout<<"f91("<<n<<") = "<<n-10<<std::endl;
std::cin>>n;
}
return 0;
}
Maybe that one will be better. My code ...
- Fri Jun 01, 2007 7:33 am
- Forum: Off topic (General chit-chat)
- Topic: What is your record of solved problems during one day?
- Replies: 18
- Views: 73841