135 条题解
-
0三中无敌 LV 8 @ 2009-10-27 21:13:05
#include
using namespace std;
const int a[100]={220,1184,2620,5020,6232,10744,12285,
17296,63020,66928,67095,69615,79750,
100485,122265,122368,141664,142310,
171856,176272,185368,196724,280540,
308620,319550,356408,437456,469028,
503056,522405,600392,609928,624184,
635624,643336,667964,726104,802725,879712,
898216,947835,998104,1077890,
1077890,1154450,1280565,1392368,1511930,1798875,2082464,
4238984,5459176,
6329416,7677248,9363584,10254970,13921528,16137628,50997596,
52695376,56055872,56512610,56924192,58580540,59497888,63560025,
63717615,66595130,66854710,67729064,67738268,68891992,71015260,
71241830,72958556,73032872,74055952,74386305,74769345,75171808,
75226888,78088504,78447010,79324875,80422335,82633005,83135650,
84521745,84591405,86158220,87998470,88144630,89477984,90437150,91996816,
93837808,95629904,95791430,96304845,97041735};
int i,s=0,g,h;
int main(){
cin>>g>>h;
for(i=0;i=g&&a[i] -
02009-10-24 16:29:28@
编译通过...
├ 测试数据 01:答案正确... 0ms
├ 测试数据 02:答案正确... 0ms
├ 测试数据 03:答案正确... 0ms
├ 测试数据 04:答案正确... 0ms
├ 测试数据 05:答案正确... 0ms
├ 测试数据 06:答案正确... 0ms
├ 测试数据 07:答案正确... 0ms
├ 测试数据 08:答案正确... 0ms
├ 测试数据 09:答案正确... 0ms
├ 测试数据 10:答案正确... 0ms
---|---|---|---|---|---|---|---|-
Accepted 有效得分:100 有效耗时:0ms经典的打表题
-
02009-10-23 23:10:52@
明明超时,结果显示我过了~~~~
-
02009-10-23 10:31:37@
编译通过...
├ 测试数据 01:答案正确... 0ms
├ 测试数据 02:答案正确... 0ms
├ 测试数据 03:答案正确... 0ms
├ 测试数据 04:答案正确... 0ms
├ 测试数据 05:答案正确... 0ms
├ 测试数据 06:答案正确... 0ms
├ 测试数据 07:答案正确... 72ms
├ 测试数据 08:答案正确... 0ms
├ 测试数据 09:答案正确... 134ms
├ 测试数据 10:答案正确... 150ms
---|---|---|---|---|---|---|---|-
Accepted 有效得分:100 有效耗时:356ms筛法算素数表再判断...结果还不如朴素的试除....
-
02009-10-22 21:54:43@
#include
using namespace std;
int a[100]={220,1184,2620,5020,6232,10744,12285, 17296,63020,66928,67095,69615,79750, 100485,122265,122368,141664,142310, 171856,176272,185368,196724,280540, 308620,319550,356408,437456,469028, 503056,522405,600392,609928,624184, 635624,643336,667964,726104,802725,879712,
898216,947835,998104,1077890, 1077890,1154450,1280565,1392368,1511930,1798875,2082464, 4238984,5459176, 6329416,7677248,9363584,10254970,13921528,16137628,50997596, 52695376,56055872,56512610,56924192,58580540,59497888,63560025, 63717615,66595130,66854710,67729064,67738268,68891992,71015260,
71241830,72958556,73032872,74055952,74386305,74769345,75171808, 75226888,78088504,78447010,79324875,80422335,82633005,83135650, 84521745,84591405,86158220,87998470,88144630,89477984,90437150,91996816, 93837808,95629904,95791430,96304845,97041735};
int main ()
{
int x,y,i,j,k,l,n=0;
cin>>x>>y;
for (i=0;i=x&&a[i] -
02009-10-10 21:20:00@
编译通过...
├ 测试数据 01:运行超时...
├ 测试数据 02:答案正确... 0ms
├ 测试数据 03:运行超时...
├ 测试数据 04:答案正确... 0ms
├ 测试数据 05:运行超时...
├ 测试数据 06:运行超时...
├ 测试数据 07:运行超时...
├ 测试数据 08:运行超时...
├ 测试数据 09:运行超时...
├ 测试数据 10:运行超时...
---|---|---|---|---|---|---|---|-
Unaccepted 有效得分:20 有效耗时:0ms囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧
-
02009-09-17 21:53:11@
program p1216;
const
a:array[1..53] of longint=(220,1184,2620,5020,6232,10744,12285,17296,63020,66928,67095,69615,79750,100485,122265,122368,141664,142310,171856,176272,185368,196724,280540,308620,319550,356408,437456,469028,503056,522405,600392,609928,624184,635624,643336,
667964,726104,802725,879712,898216,947835,998104,1077890,1154450,1156870,1175265,1185376,1280565,1328470,1358595,1392368,1466150,1468324);
var i,x,y,sbwensb:longint;
begin
readln(x,y);
for i:=1 to 53 do
if (a[i]>=x) and (a[i] -
02009-09-13 21:28:56@
我很恶
const
x: array[1..47] of longint = (220,1184,2620,5020,6232,10744,12285,17296,63020,66928,67095,69615,79750,100485,122265,122368,141664,142310,171856,180848,185368,196724,280540,308620,319550,356408,437456,469028,503056,522405,600392,609928,624184,635624,643336,667964,726104,802725,879712,898216,947835,9980104,9363544,9478910,9491625,9660950,10025290);
y: array[1..47] of longint = (284,1210,2924,5564,6368,10856,14595,18416,76084,66992,71145,87633,88730,124155,139815,123152,153176,168730,176336,176272,203432,202444,365084,389924,430402,399592,455344,486178,514736,525915,669688,686072,691256,712216,652664,783556,796696,863835,901424,980984,1125765,1043096,9437056,11049730,10950615,10025290,11791935); -
02009-08-31 22:26:47@
编译通过...
├ 测试数据 01:答案正确... 0ms
├ 测试数据 02:答案正确... 0ms
├ 测试数据 03:答案正确... 0ms
├ 测试数据 04:答案正确... 0ms
├ 测试数据 05:答案正确... 0ms
├ 测试数据 06:答案正确... 0ms
├ 测试数据 07:答案正确... 88ms
├ 测试数据 08:答案正确... 0ms
├ 测试数据 09:答案正确... 197ms
├ 测试数据 10:答案正确... 181ms
---|---|---|---|---|---|---|---|-
Accepted 有效得分:100 有效耗时:466ms+了一句 if (j>i+100000) continue; 的結果。。
-
02009-08-31 20:27:01@
编译通过...
├ 测试数据 01:答案正确... 0ms
├ 测试数据 02:答案正确... 0ms
├ 测试数据 03:答案正确... 0ms
├ 测试数据 04:答案正确... 0ms
├ 测试数据 05:答案正确... 0ms
├ 测试数据 06:答案正确... 0ms
├ 测试数据 07:答案正确... 103ms
├ 测试数据 08:答案正确... 0ms
├ 测试数据 09:答案正确... 228ms
├ 测试数据 10:答案正确... 197ms
---|---|---|---|---|---|---|---|-
Accepted 有效得分:100 有效耗时:528ms
#include
using namespace std;
main ()
{
int A,B,s=0,k1=0,k2=0;
cin>>A>>B;
for (int i=A;i -
02009-08-28 12:50:49@
编译通过...
├ 测试数据 01:答案正确... 0ms
├ 测试数据 02:答案正确... 0ms
├ 测试数据 03:答案正确... 0ms
├ 测试数据 04:答案正确... 0ms
├ 测试数据 05:答案正确... 0ms
├ 测试数据 06:答案正确... 0ms
├ 测试数据 07:答案正确... 25ms
├ 测试数据 08:答案正确... 0ms
├ 测试数据 09:答案正确... 134ms
├ 测试数据 10:答案正确... 119msRP机
var
a,b,a1,a2,g,c1,c2:longint;
ok:boolean;
begin
readln(a,b);
for a1:=a to b do
begin
c1:=1;
for a2:=2 to trunc(sqrt(a1)) do if a1 mod a2=0 then c1:=c1+a2+(a1 div a2);
if c1>a1 then
begin
c2:=1;
ok:=true;
for a2:=2 to trunc(sqrt(c1)) do
begin
if c1 mod a2=0 then c2:=c2+a2+(c1 div a2);
if c2>a1 then begin ok:=false; break; end;
end;
end;
if (c2=a1)and(ok=true) then inc(g);
end;
writeln(g);
end.
模拟 -
02009-08-19 20:45:52@
打表万岁万岁万万岁!!!
-
02009-08-19 15:09:14@
const
a:array[1..53] of longint=(220,1184,2620,5020,6232,10744,12285,17296,63020,66928,67095,69615,79750,100485,122265,122368,141664,142310,171856,176272,185368,196724,280540,308620,319550,356408,437456,469028,503056,522405,600392,609928,624184,635624,643336,
667964,726104,802725,879712,898216,947835,998104,1077890,1154450,1156870,1175265,1185376,1280565,1328470,1358595,1392368,1466150,1468324);
var
x,y,tot1,tot2,tt,i,j:longint;begin
readln(x,y);
for i:=1 to 53 do
if (a[i]>=x) and (a[i] -
02009-08-13 19:53:49@
简单的枚举
加点剪枝和优化就AC了 -
02009-08-12 09:57:24@
├ 测试数据 01:答案正确... 0ms
├ 测试数据 02:答案正确... 0ms
├ 测试数据 03:答案正确... 0ms
├ 测试数据 04:答案正确... 0ms
├ 测试数据 05:答案正确... 0ms
├ 测试数据 06:答案正确... 0ms
├ 测试数据 07:答案正确... 72ms
├ 测试数据 08:答案正确... 0ms
├ 测试数据 09:答案正确... 197ms
├ 测试数据 10:答案正确... 166ms为什么这么搞笑... 明明A,B相差是10^5,明显应该超时才对啊!
-
02009-08-07 17:36:30@
朴素算法过这个数据是没问题,但如果数据到十万以上差不多就超时了。
-
02009-08-06 10:47:51@
纯模拟!
-
02009-08-04 10:33:07@
编译通过...
├ 测试数据 01:答案正确... 0ms
├ 测试数据 02:答案正确... 0ms
├ 测试数据 03:答案正确... 0ms
├ 测试数据 04:答案正确... 0ms
├ 测试数据 05:答案正确... 0ms
├ 测试数据 06:答案正确... 0ms
├ 测试数据 07:答案正确... 25ms
├ 测试数据 08:答案正确... 0ms
├ 测试数据 09:答案正确... 88ms
├ 测试数据 10:答案正确... 88ms
---|---|---|---|---|---|---|---|-
Accepted 有效得分:100 有效耗时:201ms
---|---|---|---|---|---|---|---|-
朴素。。才是王道program P1216;
var sum1,j,a,b,sum2,i,total:longint;
begin
readln(a,b);
for i:=a to b do
if (i mod 2=0) or ((i mod 20) and (i mod 5=0)) then
begin
sum1:=1;
for j:=2 to trunc(sqrt(i)) do
if i mod j=0 then begin inc(sum1,j);inc(sum1,i div j);end;
if sum1>i then
begin
sum2:=1;
for j:=2 to trunc(sqrt(sum1)) do
if sum1 mod j=0 then begin inc(sum2,j);inc(sum2,sum1 div j);end;
if sum2=i then inc(total);
end;
end;
write(total);
end. -
02009-08-04 10:32:15@
编译通过...
├ 测试数据 01:答案正确... 0ms
├ 测试数据 02:答案正确... 0ms
├ 测试数据 03:答案正确... 0ms
├ 测试数据 04:答案正确... 0ms
├ 测试数据 05:答案正确... 0ms
├ 测试数据 06:答案正确... 0ms
├ 测试数据 07:答案正确... 72ms
├ 测试数据 08:答案正确... 0ms
├ 测试数据 09:答案正确... 197ms
├ 测试数据 10:答案正确... 150ms
---|---|---|---|---|---|---|---|-
Accepted 有效得分:100 有效耗时:419ms
朴素,真的很朴素。。。 -
02009-07-30 15:08:49@
#include
#include
#include
#include
int i,j,k;
int temp;
int ans;
int a,b;
int search(long num)
{
int i;
int temp;temp=1;
for(i=2;i