AtCoder Beginner Contest 001

Submission #404073

Source codeソースコード

#include <iostream>
#include <string>
using namespace std;
int judge(double rdisn)
{
	if(rdisn<0.25) return 0;
	else if(rdisn<1.55) return 1;
	else if(rdisn<3.35) return 2;
	else if(rdisn<5.45) return 3;
	else if(rdisn<7.95) return 4;
	else if(rdisn<10.75) return 5;
	else if(rdisn<13.85) return 6;
	else if(rdisn<17.15) return 7;
	else if(rdisn<20.75) return 8;
	else if(rdisn<24.45) return 9;
	else if(rdisn<28.45) return 10;
	else if(rdisn<=32.65) return 11;
	else return 12;
}

string dirjudge(double rdegn)
{
	
	if(11.25<=rdegn && rdegn<33.75) return "NNE";
	else if(rdegn<56.25) return "NE";
	else if(rdegn<78.75) return "ENE";
	else if(rdegn<101.25) return "E";
	else if(rdegn<123.75) return "ESE";
	else if(rdegn<146.25) return "SE";
	else if(rdegn<168.75) return "SSE";
	else if(rdegn<191.25) return "S";
	else if(rdegn<213.75) return "SSW";
	else if(rdegn<236.25) return "SW";
	else if(rdegn<258.75) return "WSW";
	else if(rdegn<281.25) return "W";
	else if(rdegn<303.75) return "WNW";
	else if(rdegn<326.25) return "NW";
	else if(rdegn<348.75) return "NNW";
	else return "N";
}

int main()
{
	int degn,disn;
	double rdegn,rdisn;
	cin>>degn>>disn;
	if(degn==0){
		rdegn=0.0;
		rdisn = disn;
		rdisn/=60;
	}else if(disn==0)
	{
		rdegn = (double)degn/10.0;
		rdisn=0.0;
	}
	else 
	{
		rdegn = (double)degn/10.0;
		rdisn = disn;
		rdisn/=60;
	}
	
	if(judge(rdisn)==0) cout<<"C 0"<<endl;
	else cout<<dirjudge(rdegn)<<" "<<judge(rdisn)<<endl;
}

Submission

Task問題 A - 積雪深差
User nameユーザ名 Q2hpaGlybw==
Created time投稿日時
Language言語 C++ (G++ 4.6.4)
Status状態 WA
Score得点 0
Source lengthソースコード長 1515 Byte
File nameファイル名
Exec time実行時間 ms
Memory usageメモリ使用量 -

Test case

Set

Set name Score得点 / Max score Cases
all 0 / 100 00_sample_01.txt,00_sample_02.txt,00_sample_03.txt,test_01.txt,test_02.txt,test_03.txt,test_04.txt,test_05.txt,test_06.txt,test_07.txt,test_08.txt,test_09.txt,test_10.txt,test_11.txt,test_12.txt,test_13.txt,test_14.txt,test_15.txt,test_16.txt,test_17.txt

Test case

Case name Status状態 Exec time実行時間 Memory usageメモリ使用量
00_sample_01.txt WA
00_sample_02.txt WA
00_sample_03.txt WA
test_01.txt WA
test_02.txt WA
test_03.txt WA
test_04.txt WA
test_05.txt WA
test_06.txt WA
test_07.txt WA
test_08.txt WA
test_09.txt WA
test_10.txt WA
test_11.txt WA
test_12.txt WA
test_13.txt WA
test_14.txt WA
test_15.txt WA
test_16.txt WA
test_17.txt WA