AtCoder Beginner Contest 001

Submission #1335737

Source codeソースコード

#include <stdio.h>

int main() {
	int deg, dis;
	int hu, f;
	int dir;
	const char houi[] = "C\0\0\0N\0\0\0NNE\0NE\0\0ENE\0E\0\0\0ESE\0SE\0\0SSE\0S\0\0\0SSW\0SW\0\0WSW\0W\0\0\0WNW\0NW\0\0NNW\0";
	scanf("%d %d", &deg, &dis);
	hu = dis / 6 + ((dis * 100/60)%10>4);


	if (hu <= 2) {
		f = 0;
	}
	else if (hu <= 15) {
		f = 1;
	}
	else if (hu <= 33) {
		f = 2;
	}
	else if (hu <= 54) {
		f = 3;
	}
	else if (hu <= 79) {
		f = 4;
	}
	else if (hu <= 107) {
		f = 5;
	}
	else if (hu <= 138) {
		f = 6;
	}
	else if (hu <= 171) {
		f = 7;
	}
	else if (hu <= 207) {
		f = 8;
	}
	else if (hu <= 244) {
		f = 9;
	}
	else if (hu <= 284) {
		f = 10;
	}
	else if (hu <= 326) {
		f = 11;
	}
	else {
		f = 12;
	}

	//225
	if (f>0) {
		dir = ((deg - 113) / 225 + 1)%16+1;
	}
	else { dir = 0; }

	printf("%s", &houi[dir*4]);
	printf(" %d\n", f);

	return 0;
}

Submission

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

Compiler messageコンパイルメッセージ

./Main.cpp: In function ‘int main()’:
./Main.cpp:8:28: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%d %d", &deg, &dis);
^

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