結果

問題 No.338 アンケート機能
ユーザー bal4ubal4u
提出日時 2019-04-15 14:48:52
言語 C
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 487 bytes
コンパイル時間 180 ms
コンパイル使用メモリ 30,568 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-22 06:37:00
合計ジャッジ時間 1,516 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,348 KB
testcase_01 AC 1 ms
4,348 KB
testcase_02 AC 1 ms
4,348 KB
testcase_03 AC 1 ms
4,348 KB
testcase_04 AC 1 ms
4,348 KB
testcase_05 WA -
testcase_06 AC 1 ms
4,348 KB
testcase_07 WA -
testcase_08 AC 1 ms
4,348 KB
testcase_09 WA -
testcase_10 AC 1 ms
4,348 KB
testcase_11 AC 1 ms
4,348 KB
testcase_12 AC 1 ms
4,348 KB
testcase_13 AC 1 ms
4,348 KB
testcase_14 AC 1 ms
4,348 KB
testcase_15 AC 1 ms
4,348 KB
testcase_16 AC 1 ms
4,348 KB
testcase_17 AC 1 ms
4,348 KB
testcase_18 AC 1 ms
4,348 KB
testcase_19 AC 1 ms
4,348 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 2 ms
4,348 KB
testcase_24 AC 1 ms
4,348 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 1 ms
4,348 KB
testcase_29 AC 1 ms
4,348 KB
testcase_30 AC 2 ms
4,348 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c:8:5: warning: conflicting types for built-in function 'round'; expected 'double(double)' [-Wbuiltin-declaration-mismatch]
    8 | int round(int a, int s)
      |     ^~~~~
main.c:5:1: note: 'round' is declared in header '<math.h>'
    4 | #include <stdio.h>
  +++ |+#include <math.h>
    5 | 

ソースコード

diff #

// yukicoder: No.338 アンケート機能
// 2019.4.15 bal4u

#include <stdio.h>

int tbl[101][101];

int round(int a, int s)
{
	int ans = a / s;
	if ((10 * a / s) % 10 >= 5) ans++;
	return ans;
}

int main()
{
	int a, b, A, B;

	for (a = 0; a <= 100; a++) for (b = 0; b <= 100; b++) if (a + b > 0) {
		A = round(100 * a, a + b), B = round(100 * b, a + b);
		if (tbl[A][B] == 0 || tbl[A][B] > a + b) tbl[A][B] = a + b;
	}
	scanf("%d%d", &A, &B);
	printf("%d\n", tbl[A][B]);
	return 0;
}
0