結果

問題 No.512 魔法少女の追いかけっこ
ユーザー _massibu_massibu
提出日時 2017-05-05 23:50:06
言語 C
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 1,305 bytes
コンパイル時間 147 ms
コンパイル使用メモリ 28,976 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-09 13:18:16
合計ジャッジ時間 1,886 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 1 ms
4,380 KB
testcase_13 AC 0 ms
4,376 KB
testcase_14 AC 1 ms
4,376 KB
testcase_15 WA -
testcase_16 AC 0 ms
4,376 KB
testcase_17 AC 0 ms
4,380 KB
testcase_18 AC 1 ms
4,380 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 0 ms
4,376 KB
testcase_22 AC 1 ms
4,376 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 7 ms
4,380 KB
testcase_26 AC 1 ms
4,380 KB
testcase_27 AC 0 ms
4,384 KB
testcase_28 AC 2 ms
4,376 KB
testcase_29 AC 1 ms
4,380 KB
testcase_30 AC 1 ms
4,376 KB
testcase_31 WA -
testcase_32 WA -
testcase_33 AC 0 ms
4,380 KB
testcase_34 AC 0 ms
4,376 KB
testcase_35 WA -
testcase_36 WA -
testcase_37 AC 4 ms
4,376 KB
testcase_38 AC 0 ms
4,376 KB
testcase_39 AC 1 ms
4,380 KB
testcase_40 WA -
testcase_41 AC 3 ms
4,380 KB
testcase_42 AC 0 ms
4,380 KB
testcase_43 WA -
testcase_44 AC 1 ms
4,376 KB
testcase_45 AC 1 ms
4,380 KB
testcase_46 AC 1 ms
4,376 KB
testcase_47 WA -
testcase_48 WA -
testcase_49 AC 0 ms
4,376 KB
testcase_50 AC 1 ms
4,376 KB
testcase_51 WA -
testcase_52 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include "stdio.h"

int main()
{
	//変数を宣言し、配列はforで初期化する。
	//役割は、順番に「koboの時速」「師匠の時速」「交差点の数」「交差点の位置(m)」。
	int X = 0, Y = 0, N = 0;
	long A[90];
	for (int i = 0; i < 90; i++) {
		A[i] = 0;
	}

	//scanfで変数の値を入力。
	//AはforをN回やってとる
	scanf("%d %d",&X,&Y);
	scanf("%d",&N);
	for (int i = 0; i < N; i++) {
		scanf("%ld", &A[i]);
	}

	//時速を秒速に直す。これは小数になりうるので実数型で。
	double rX = X/3.6, rY = Y/3.6;
	//変換できてるか表示テスト
	//printf("%f %f \n", rX, rY);

	

	//0.01秒ずつ進めていってみよう…。
	//それぞれXとYの位置。交差点の個数でも見る。
	//ただし、判定時のためにXのほうは到達時点でカウント、Yのほうは通過時点でカウント。
	double Xin = 0.0, Yin = 0.0;
	int Xpoint = 0, Ypoint = 0;
	while (1) {
		Xin = Xin + rX / 100.0;
		Yin = Yin + rY / 100.0;
		if (Yin > A[Ypoint])
			Ypoint++;
		//Xが交差点に到達した際に判定を行う。
		if (Xin >= A[Xpoint]) {
			Xpoint++;
			if (Ypoint > Xpoint) {
				printf("NO");
				break;
			}
			if (Xpoint == N - 1) {
				printf("YES");
				break;
			}

		}
			
	}

    return 0;
}

0