Submission #9154186
Source Code Expand
Copy
varans,base,L1,R1,L2,R2,L3,R3,i,A,B,k:int64;beginread(L1,R1,L2,R2,L3,R3);base:=(R1-L1+1)*(R2-L2+1)*(R3-L3+1);if L2>L3 then beginA:=L2;L2:=L3;L3:=A;A:=R2;R2:=R3;R3:=A;end;if L1<L2 then beginif R1<L2 then ans:=ans+(R1-L1+1)*(R2-L2+1)*(R3-L3+1)else ans:=ans+(L2-L1)*(R2-L2+1)*(R3-L3+1);L1:=L2;end;if L1<L3 then beginif(R1<L3)or(R2<L3)then beginif (L1<=R1)and(L1<=R2)then begin
var ans,base,L1,R1,L2,R2,L3,R3,i,A,B,k:int64; begin read(L1,R1,L2,R2,L3,R3); base:=(R1-L1+1)*(R2-L2+1)*(R3-L3+1); if L2>L3 then begin A:=L2; L2:=L3; L3:=A; A:=R2; R2:=R3; R3:=A; end; if L1<L2 then begin if R1<L2 then ans:=ans+(R1-L1+1)*(R2-L2+1)*(R3-L3+1) else ans:=ans+(L2-L1)*(R2-L2+1)*(R3-L3+1); L1:=L2; end; if L1<L3 then begin if(R1<L3)or(R2<L3)then begin if (L1<=R1)and(L1<=R2)then begin if R1<R2 then k:=R1-L1+1 else k:=R2-L1+1; ans:=ans+(R3-L3+1)*(k*(R2-L1)-k*(k-1)div 2); end; end else begin k:=L3-L1; ans:=ans+(R3-L3+1)*(k*(R2-L1)-k*(k-1)div 2); end; L1:=L3; end; if(L1<=R1)and(L1<R2)and(L1<R3)then begin if R1<R2 then if R1<R3 then A:=R1 else A:=R3 else if R2<R3 then A:=R2 else A:=R3; k:=A-L1+1; B:=L1-1; ans:=ans+R2*R3*k-(R2+R3)*(L1*k+k*(k-1)div 2)+A*(A+1)*(2*A+1)div 6-B*(B+1)*(2*B+1)div 6; end; writeln(ans/base:0:9); end.
Submission Info
Submission Time | |
---|---|
Task | C - 罰ゲーム |
User | kotatsugame |
Language | Pascal (FPC 2.6.2) |
Score | 100 |
Code Size | 940 Byte |
Status | AC |
Exec Time | 0 ms |
Memory | 128 KB |
Compile Error
/usr/bin/ld.bfd: warning: ./link.res contains output sections; did you forget -T?
Judge Result
Set Name | Sample | Subtask1 | Subtask2 | Subtask3 | Subtask4 | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 16 / 16 | 35 / 35 | 29 / 29 | 20 / 20 | ||||||||||
Status |
|
|
|
|
|
Set Name | Test Cases |
---|---|
Sample | sample_01.txt, sample_02.txt, sample_03.txt |
Subtask1 | sample_01.txt, sub1_in01.txt, sub1_in02.txt, sub1_in03.txt, sub1_in04.txt, sub1_in05.txt |
Subtask2 | sample_01.txt, sample_02.txt, sub2_in01.txt, sub2_in02.txt, sub2_in03.txt, sub2_in04.txt, sub2_in05.txt, sub2_in06.txt, sub2_in07.txt, sub2_in08.txt |
Subtask3 | sample_01.txt, sample_02.txt, sample_03.txt, sub2_in01.txt, sub2_in02.txt, sub2_in03.txt, sub2_in04.txt, sub2_in05.txt, sub2_in06.txt, sub2_in07.txt, sub2_in08.txt, sub3_in01.txt, sub3_in02.txt, sub3_in03.txt, sub3_in04.txt, sub3_in05.txt, sub3_in06.txt, sub3_in07.txt, sub3_in08.txt |
Subtask4 | sample_01.txt, sample_02.txt, sample_03.txt, sub1_in01.txt, sub1_in02.txt, sub1_in03.txt, sub1_in04.txt, sub1_in05.txt, sub2_in01.txt, sub2_in02.txt, sub2_in03.txt, sub2_in04.txt, sub2_in05.txt, sub2_in06.txt, sub2_in07.txt, sub2_in08.txt, sub3_in01.txt, sub3_in02.txt, sub3_in03.txt, sub3_in04.txt, sub3_in05.txt, sub3_in06.txt, sub3_in07.txt, sub3_in08.txt, sub4_in01.txt, sub4_in02.txt, sub4_in03.txt, sub4_in04.txt, sub4_in05.txt, sub4_in06.txt, sub4_in07.txt, sub4_in08.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
sample_01.txt | AC | 0 ms | 128 KB |
sample_02.txt | AC | 0 ms | 128 KB |
sample_03.txt | AC | 0 ms | 128 KB |
sub1_in01.txt | AC | 0 ms | 128 KB |
sub1_in02.txt | AC | 0 ms | 128 KB |
sub1_in03.txt | AC | 0 ms | 128 KB |
sub1_in04.txt | AC | 0 ms | 128 KB |
sub1_in05.txt | AC | 0 ms | 128 KB |
sub2_in01.txt | AC | 0 ms | 128 KB |
sub2_in02.txt | AC | 0 ms | 128 KB |
sub2_in03.txt | AC | 0 ms | 128 KB |
sub2_in04.txt | AC | 0 ms | 128 KB |
sub2_in05.txt | AC | 0 ms | 128 KB |
sub2_in06.txt | AC | 0 ms | 128 KB |
sub2_in07.txt | AC | 0 ms | 128 KB |
sub2_in08.txt | AC | 0 ms | 128 KB |
sub3_in01.txt | AC | 0 ms | 128 KB |
sub3_in02.txt | AC | 0 ms | 128 KB |
sub3_in03.txt | AC | 0 ms | 128 KB |
sub3_in04.txt | AC | 0 ms | 128 KB |
sub3_in05.txt | AC | 0 ms | 128 KB |
sub3_in06.txt | AC | 0 ms | 128 KB |
sub3_in07.txt | AC | 0 ms | 128 KB |
sub3_in08.txt | AC | 0 ms | 128 KB |
sub4_in01.txt | AC | 0 ms | 128 KB |
sub4_in02.txt | AC | 0 ms | 128 KB |
sub4_in03.txt | AC | 0 ms | 128 KB |
sub4_in04.txt | AC | 0 ms | 128 KB |
sub4_in05.txt | AC | 0 ms | 128 KB |
sub4_in06.txt | AC | 0 ms | 128 KB |
sub4_in07.txt | AC | 0 ms | 128 KB |
sub4_in08.txt | AC | 0 ms | 128 KB |