-1
This commit is contained in:
parent
ebab65979f
commit
02d28f223e
26
.vscode/c.code-snippets
vendored
26
.vscode/c.code-snippets
vendored
@ -54,18 +54,6 @@
|
|||||||
],
|
],
|
||||||
"description": "Define for i"
|
"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": {
|
"Define function put bool": {
|
||||||
"prefix": "fn_putbool",
|
"prefix": "fn_putbool",
|
||||||
"body": ["#define putbool(x) (printf(\"%s\", (x) ? \"TRUE\" : \"FALSE\"))"],
|
"body": ["#define putbool(x) (printf(\"%s\", (x) ? \"TRUE\" : \"FALSE\"))"],
|
||||||
@ -81,9 +69,15 @@
|
|||||||
"body": ["#define min(i, j) (((i) < (j)) ? (i) : (j))"],
|
"body": ["#define min(i, j) (((i) < (j)) ? (i) : (j))"],
|
||||||
"description": "Define function min"
|
"description": "Define function min"
|
||||||
},
|
},
|
||||||
"Define Boolean": {
|
"Define bool": {
|
||||||
"prefix": "define_boolean",
|
"prefix": "define_bool",
|
||||||
"body": ["#define bool int", "#define true 1", "#define false 0"],
|
"body": [
|
||||||
"description": "Define Boolean"
|
"#ifndef bool",
|
||||||
|
"#define bool int",
|
||||||
|
"#define true 1",
|
||||||
|
"#define false 0",
|
||||||
|
"#endif"
|
||||||
|
],
|
||||||
|
"description": "Define bool"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
15
.vscode/c.template.code-snippets
vendored
15
.vscode/c.template.code-snippets
vendored
@ -11,6 +11,21 @@
|
|||||||
"#define $fc _template_func_call"
|
"#define $fc _template_func_call"
|
||||||
],
|
],
|
||||||
"description": "Define template"
|
"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": {
|
"Define sort": {
|
||||||
"prefix": "define_sort",
|
"prefix": "define_sort",
|
||||||
|
21
0401-t/1.c
Normal file
21
0401-t/1.c
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user