diff --git a/.vscode/c.code-snippets b/.vscode/c.code-snippets index 0746260..72229a3 100644 --- a/.vscode/c.code-snippets +++ b/.vscode/c.code-snippets @@ -54,18 +54,6 @@ ], "description": "Define for i" }, - "Define var swapper": { - "prefix": "fn_define_swapper", - "body": [ - "#define DEFINE_SWAPPER(type) \\", - " void swap_##type(type *a, type *b) { \\", - " type t = *a; \\", - " *a = *b; \\", - " *b = t; \\", - " }" - ], - "description": "Define var swapper" - }, "Define function put bool": { "prefix": "fn_putbool", "body": ["#define putbool(x) (printf(\"%s\", (x) ? \"TRUE\" : \"FALSE\"))"], @@ -81,9 +69,15 @@ "body": ["#define min(i, j) (((i) < (j)) ? (i) : (j))"], "description": "Define function min" }, - "Define Boolean": { - "prefix": "define_boolean", - "body": ["#define bool int", "#define true 1", "#define false 0"], - "description": "Define Boolean" + "Define bool": { + "prefix": "define_bool", + "body": [ + "#ifndef bool", + "#define bool int", + "#define true 1", + "#define false 0", + "#endif" + ], + "description": "Define bool" } } diff --git a/.vscode/c.template.code-snippets b/.vscode/c.template.code-snippets index c1b381d..ebb1a84 100644 --- a/.vscode/c.template.code-snippets +++ b/.vscode/c.template.code-snippets @@ -12,6 +12,21 @@ ], "description": "Define template" }, + "Define swap": { + "prefix": "define_swap", + "body": [ + "#define T_swap__(size, a, b) \\", + " { \\", + " void *INBLOCK_TMP = malloc(size); \\", + " memcpy(INBLOCK_TMP, a, size); \\", + " memcpy(a, b, size); \\", + " memcpy(b, INBLOCK_TMP, size); \\", + " free(INBLOCK_TMP); \\", + " }", + "#define T_swap(T) T_swap__" + ], + "description": "Define swap" +}, "Define sort": { "prefix": "define_sort", "body": [ diff --git a/0401-t/1.c b/0401-t/1.c new file mode 100644 index 0000000..a1ac608 --- /dev/null +++ b/0401-t/1.c @@ -0,0 +1,21 @@ +#include + +int main() { + int n, m, a[101], i, j, num[101] = {0}, ans = 1; + scanf("%d", &n); + for (i = 1; i <= n; i++) + scanf("%d", &a[i]); + scanf("%d", &m); + for (i = 1; i <= n; i++) { + if (m < a[i]) { + if (num[a[i]]) + continue; + else { + ans++; + num[a[i]]++; + } + } + } + printf("%d", ans); + return 0; +} \ No newline at end of file