9点半从纪中出发,大概11点多来到广州六中。
在六中旁边一家小餐馆吃了中餐,那餐厅真心很贵,一盆饭就要20元,我们那桌吃了四
盆...... XC:不想买单啦~\(≧▽≦)/~啦啦啦
然后就来到六中的某个功能室百无聊赖的休息了一会儿,两点钟进考场。
两点半:
比赛开始,还是先看题...一二两题太水了,直接开码,1小时搞定两题、
三点半:
仔细阅读第三题题目,还是想不到100分做法,看来这次不能AK了,
选了70分暴力直接开切1小时搞定
四点半:
肩负着AC第四题的使命,在草稿纸上胡乱地推着式子、
貌似暴力四重循环只能拿40-50分,不行,还要继续想
然后我就把3条公式的变形全部写出来,
终于推出了三重循环,
枚举Xa、Xb、Xc三处魔法值,然后再根据公式推出第四处,1小时搞定
实测得到能拿80~85分
五点半:
还剩半个小时,继续检查,随心所欲地出着数据..............
六点:
比赛结束~
估分:100+100+70+80=350分
洛谷得分:100+100+70+85=355分
纪中数据:100+100+70+85=355分
NOIP官方初评:100+100+70+85=355分
比赛代码:
第一题:
var n,x1,y1,x2,y2,x3,y3,min1,min2,min3:longint;
function min(x,y:longint):longint;
begin
if x<y then exit(x) else exit(y);
end;
begin
assign(input,'pencil.in');reset(input);
assign(output,'pencil.out');rewrite(output);
readln(n);
readln(x1,y1);
readln(x2,y2);
readln(x3,y3);
if n mod x1>0 then min1:=(n div x1+1)*y1 else min1:=(n div x1)*y1;
if n mod x2>0 then min2:=(n div x2+1)*y2 else min2:=(n div x2)*y2;
if n mod x3>0 then min3:=(n div x3+1)*y3 else min3:=(n div x3)*y3;
writeln(min(min(min1,min2),min3));
close(input);close(output);
end.
第二题:
var a:array[1..12]of longint=(31,28,31,30,31,30,31,31,30,31,30,31);
s1,s2,s3:string;
i,j,bz,x1,x2,x3,y1,y2,y3,tot:longint;
begin
assign(input,'date.in');reset(input);
assign(output,'date.out');rewrite(output);
readln(s1);
readln(s2);
val(copy(s1,1,4),x1);
val(copy(s1,5,2),x2);
val(copy(s1,7,2),x3);
val(copy(s2,1,4),y1);
val(copy(s2,5,2),y2);
val(copy(s2,7,2),y3);
for i:=1to 4 do
if s1[i]<>s1[9-i] then
begin
bz:=1;
break;
end;
if bz=0 then inc(tot);
while(x1<y1)or((x1=y1)and(x2<y2))or((x1=y1)and(x2=y2)and(x3<y3)) do
begin
inc(x3);
if x3>a[x2] then
begin
if (x2=2)and(x3=29)and(((x1 mod 4=0)and(x1 mod 100>0))or(x1 mod 400=0)) then else
begin
x3:=1;
inc(x2);
if x2>12then
begin
x2:=1;
inc(x1);
end;
end;
end;
str(x1,s1);
str(x2,s2);
str(x3,s3);
if x2>9 then s1:=s1+s2 else s1:=s1+'0'+s2;
if x3>9 then s1:=s1+s3 else s1:=s1+'0'+s3;
bz:=0;
for i:=1 to 4 do
if s1[i]<>s1[9-i] then
begin
bz:=1;
break;
end;
if bz=0 then inc(tot);
end;
writeln(tot);
close(input);close(output);
end.
var n,i,j,t,k,l:longint;
a:array[0..1000,0..3000]of longint;
b:array[0..100000]of longint;
c:array[0..100000]of longint;
begin
assign(input,'port.in');reset(input);
assign(output,'port.out');rewrite(output);
readln(n);
for i:=1to n do
begin
read(b[i],a[i,0]);
for j:=1 to a[i,0] do
begin
read(a[i,j]);
inc(c[a[i,j]]);
if c[a[i,j]]=1 then inc(l);
end;
while b[i]-86400>=b[t] do
begin
for k:=1 to a[t,0] do
begin
dec(c[a[t,k]]);
if c[a[t,k]]=0 then dec(l);
end;
inc(t);
end;
writeln(l);
end;
close(input);close(output);
end.
第四题:
var i,j,k1,k2,n,m,t:longint;
a:array[1..40000]of longint;
b:array[1..15000,1..4]of int64;
c:array[1..15000]of longint;
begin
assign(input,'magic.in');reset(input);
assign(output,'magic.out');rewrite(output);
readln(n,m);
for i:=1to m do
begin
readln(a[i]);
inc(c[a[i]]);
end;
for i:=1to n-3 do
begin
if c[i]=0 then continue;
for j:=i+1 to n-2 do
begin
if c[j]=0 then continue;
if(j-i) mod 2=1 then continue;
t:=j+3*(j-i)+1;
if t>n-1 then break;
for k1:=t to n-1 do
begin
if c[k1]=0 then continue;
k2:=(j-i) div 2+k1;
if k2>n then break;
if c[k2]=0 then continue;
b[i,1]:=b[i,1]+c[j]*c[k1]*c[k2];
b[j,2]:=b[j,2]+c[i]*c[k1]*c[k2];
b[k1,3]:=b[k1,3]+c[i]*c[j]*c[k2];
b[k2,4]:=b[k2,4]+c[i]*c[j]*c[k1];
end;
end;
end;
for i:=1to m do
writeln(b[a[i],1],' ',b[a[i],2],' ',b[a[i],3],' ',b[a[i],4]);
close(input);close(output);
end.