Submission #19514216


Source Code Expand

Copy
// Problem: C - : (Colon)
// Contest: AtCoder - AtCoder Beginner Contest 168
// URL: https://atcoder.jp/contests/abc168/tasks/abc168_c
// Memory Limit: 1024 MB
// Time Limit: 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

#include <bits/stdc++.h>
using namespace std;

using l = long;
using ll = long long;
using ld = long double;
using db = double;
using str = string;

using pi = pair<int,int>;
using pl = pair<ll,ll>;
using pd = pair<db,db>;

using vi = vector<int>;
using vl = vector<long>;
using vll = vector<ll>;

#define mp make_pair
#define f first
#define s second

#define sz(x) (int)(x).size()
#define all(x) begin(x), end(x)
#define rsz resize
#define ins insert
#define ft front()
#define bk back()
#define pf push_front
#define pb push_back

void divisors(map<int,int>& d,ll N){
	for(int div : {2,3,5}){
		int cnt=1;
		if(N%2==0){
			while((N%2)==0){
				N/=2;
				cnt++;
			}
			d[div]=cnt;
		}
	}
	static array<int,8> increments = {4,2,4,2,4,6,2,6};
	int i=0;
	for(ll div=7;div*div<=N;div+=increments[i++]){
		if((N%div)==0){
			int cnt=1;
			while((N%i)==0){
				N/=i;
				cnt++;
			}
			d[i]=cnt;
		}
		if(i==8)
			i=0;
	}
	if(N>1)
		d[N]=2;
}

void input(vl& v,int N){
	for(int i=0;i<N;i++){
		cin>>v[i];
	}
}

void solve(int a,int b,int h,int m){
	double pi=3.14159265;
	
	double hans=30*(h+m/(double)60);
	double mans=6*m;
	double theta=hans-mans;
	
	theta=min(theta,360.0-theta);
	double x=(theta*pi)/180;
	double c=2.0*a*b*cosf(x);
	a*=a;
	b*=b;
	a+=b-c;
	printf("%.20f",sqrtf(a));
	
	
}

int main(){
	int a,b,h,m;
	cin>>a>>b>>h>>m;
	solve(a,b,h,m);
	return 0;	
}

Submission Info

Submission Time
Task C - : (Colon)
User VaibhavSethia07
Language C++ (GCC 9.2.1)
Score 0
Code Size 1710 Byte
Status WA
Exec Time 7 ms
Memory 3972 KB

Judge Result

Set Name Sample Subtask1
Score / Max Score 0 / 0 0 / 300
Status
AC × 1
WA × 1
AC × 5
WA × 25
Set Name Test Cases
Sample sample_01.txt, sample_02.txt
Subtask1 sample_01.txt, sample_02.txt, sub1_01.txt, sub1_02.txt, sub1_03.txt, sub1_04.txt, sub1_05.txt, sub1_06.txt, sub1_07.txt, sub1_08.txt, sub1_09.txt, sub1_10.txt, sub1_11.txt, sub1_12.txt, sub1_13.txt, sub1_14.txt, sub1_15.txt, sub1_16.txt, sub1_17.txt, sub1_18.txt, sub1_19.txt, sub1_20.txt, sub1_21.txt, sub1_22.txt, sub1_23.txt, sub1_24.txt, sub1_25.txt, sub1_26.txt, sub1_27.txt, sub1_28.txt
Case Name Status Exec Time Memory
sample_01.txt AC 7 ms 3756 KB
sample_02.txt WA 2 ms 3792 KB
sub1_01.txt WA 2 ms 3872 KB
sub1_02.txt WA 2 ms 3940 KB
sub1_03.txt WA 2 ms 3756 KB
sub1_04.txt AC 2 ms 3760 KB
sub1_05.txt AC 2 ms 3724 KB
sub1_06.txt AC 2 ms 3796 KB
sub1_07.txt WA 2 ms 3968 KB
sub1_08.txt WA 2 ms 3860 KB
sub1_09.txt WA 3 ms 3800 KB
sub1_10.txt WA 2 ms 3760 KB
sub1_11.txt WA 3 ms 3796 KB
sub1_12.txt WA 2 ms 3864 KB
sub1_13.txt WA 3 ms 3860 KB
sub1_14.txt WA 2 ms 3928 KB
sub1_15.txt WA 2 ms 3920 KB
sub1_16.txt WA 2 ms 3796 KB
sub1_17.txt WA 2 ms 3724 KB
sub1_18.txt WA 3 ms 3744 KB
sub1_19.txt WA 2 ms 3724 KB
sub1_20.txt WA 7 ms 3784 KB
sub1_21.txt WA 2 ms 3796 KB
sub1_22.txt AC 2 ms 3764 KB
sub1_23.txt WA 3 ms 3724 KB
sub1_24.txt WA 2 ms 3740 KB
sub1_25.txt WA 2 ms 3720 KB
sub1_26.txt WA 3 ms 3972 KB
sub1_27.txt WA 2 ms 3936 KB
sub1_28.txt WA 2 ms 3808 KB