結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 1 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 2 ms
4,348 KB
testcase_06 AC 1 ms
4,348 KB
testcase_07 AC 1 ms
4,348 KB
testcase_08 AC 1 ms
4,348 KB
testcase_09 AC 1 ms
4,348 KB
testcase_10 AC 1 ms
4,348 KB
testcase_11 AC 2 ms
4,348 KB
testcase_12 AC 2 ms
4,348 KB
testcase_13 AC 2 ms
4,348 KB
testcase_14 AC 1 ms
4,348 KB
testcase_15 AC 1 ms
4,348 KB
testcase_16 AC 2 ms
4,348 KB
testcase_17 AC 2 ms
4,348 KB
testcase_18 AC 2 ms
4,348 KB
testcase_19 AC 2 ms
4,348 KB
testcase_20 AC 1 ms
4,348 KB
testcase_21 AC 1 ms
4,348 KB
testcase_22 AC 2 ms
4,348 KB
testcase_23 AC 2 ms
4,348 KB
testcase_24 AC 1 ms
4,348 KB
testcase_25 AC 1 ms
4,348 KB
testcase_26 AC 2 ms
4,348 KB
testcase_27 AC 2 ms
4,348 KB
testcase_28 AC 2 ms
4,348 KB
testcase_29 AC 2 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[201][201];

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 <= 201; a++) for (b = 0; b <= 201; 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