結果

問題 No.46 はじめのn歩
ユーザー subsnsubsn
提出日時 2023-05-26 10:56:47
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 650 bytes
コンパイル時間 516 ms
コンパイル使用メモリ 64,412 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-26 05:30:20
合計ジャッジ時間 1,261 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 AC 1 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

// yuki46.cpp : このファイルには 'main' 関数が含まれています。プログラム実行の開始と終了がそこで行われます。
//

#include <iostream>

int main()
{
	char str[50];
	char c = getchar();
	int str_len = 0;
	int left = 0;
	int right = 0;

	while (c != '\n') {
		str[str_len] = c;
		c = getchar();
		str_len++;
	}

	int nowIsLeft = 1;
	for (int i = 0;i < str_len;i++) {
		if (str[i] == ' ') {
			nowIsLeft = 0;
			continue;
		}
		if (nowIsLeft) {
			left = left * 10 + (str[i] - '0');
		}
		else {
			right = right * 10 + (str[i] - '0');
		}
	}
	int ans = right / left;
	if (ans == 0) ans++;
	printf("%d\n", ans);
}
0