Submission #4352690


Source Code Expand

Copy
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define ll long long
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define repp(i,l,r,k)for(ll i=(l);i<(r);i+=(k))
#define INF ((1LL<<62)-(1LL<<31))
#define max(p,q)((p)>(q)?(p):(q))
#define min(p,q)((p)<(q)?(p):(q))
#define bit(n,m)(((n)>>(m))&1)
int upll(const void*a, const void*b){return*(ll*)a<*(ll*)b?-1:*(ll*)a>*(ll*)b?1:0;}
int downll(const void*a, const void*b){return*(ll*)a<*(ll*)b?1:*(ll*)a>*(ll*)b?-1:0;}
void sortup(ll*a,int n){qsort(a,n,sizeof(ll),upll);}
void sortdown(ll*a,int n){qsort(a,n,sizeof(ll),downll);}
ll pom(ll a,ll n,int m){ll x=1;for(a%=m;n;n/=2)n&1?x=x*a%m:0,a=a*a%m;return x;}
//#define MOD 998244353
#define MOD 1000000007
#define invp(a,p)pom(a,p-2,p)


double f(double h,double a){
	double r=min(h-a,a);
	return 2*(r*r*r/3-h*r*r/2+(a*h-a*a)*r)/(h-a)/(h-a);
}



double h,w,a,b;
int main(){
	scanf("%lf%lf%lf%lf",&h,&w,&a,&b);
	printf("%.9f",f(h,a)*f(w,b));
}

Submission Info

Submission Time
Task A - Affiches
User kyopro_friends
Language C (GCC 5.4.1)
Score 500
Code Size 978 Byte
Status
Exec Time 1 ms
Memory 128 KB

Compile Error

./Main.c: In function ‘main’:
./Main.c:30:2: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
  scanf("%lf%lf%lf%lf",&h,&w,&a,&b);
  ^

Test Cases

Set Name Score / Max Score Test Cases
Sample 0 / 0 01.txt, 02.txt
All 500 / 500 01.txt, 02.txt, 10.txt, 11.txt, 12.txt, 13.txt, 14.txt, 15.txt, 16.txt, 17.txt, 18.txt, 19.txt
Case Name Status Exec Time Memory
01.txt 1 ms 128 KB
02.txt 0 ms 128 KB
10.txt 0 ms 128 KB
11.txt 0 ms 128 KB
12.txt 1 ms 128 KB
13.txt 1 ms 128 KB
14.txt 1 ms 128 KB
15.txt 0 ms 128 KB
16.txt 0 ms 128 KB
17.txt 0 ms 128 KB
18.txt 0 ms 128 KB
19.txt 0 ms 128 KB