-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e1c579c
commit d971a14
Showing
5 changed files
with
110 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#include <stdio.h> | ||
|
||
size_t max_int(const size_t a, const size_t b) | ||
{ | ||
if (a <= b) | ||
return (b); | ||
else | ||
return (a); | ||
} | ||
|
||
int main(void) | ||
{ | ||
int a, b; | ||
scanf("%d%d", &a, &b); | ||
// printf("%d %d\n", a, b); | ||
|
||
if (a == b) { | ||
printf("%d\n", a * 2); | ||
return 0; | ||
} | ||
|
||
int max = max_int(a, b); | ||
printf("%d\n", max + max-1); | ||
|
||
return (0); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#include <stdio.h> | ||
|
||
int main(void) | ||
{ | ||
int K; | ||
scanf("%d", &K); | ||
// printf("%d\n", K); | ||
|
||
char alpha = 'A'; | ||
|
||
for (int i = 1; i <= K; i++) | ||
{ | ||
printf("%c", alpha++); | ||
} | ||
printf("\n"); | ||
|
||
return (0); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
|
||
int main(void) | ||
{ | ||
int N, M; | ||
scanf("%d %d", &N, &M); | ||
// printf("%d %d\n", N, M); | ||
|
||
char **S; | ||
S = calloc(N+1, sizeof(char *)); | ||
for (int i = 0; i < N; i++) { | ||
S[i] = calloc(M+5, sizeof(char)); | ||
scanf("%s", S[i]); | ||
// printf("S=[%i]=%s\n",i, S[i]); | ||
} | ||
|
||
int ans = 0; | ||
for (int i = 0; i < N; i++) { | ||
for (int j = i + 1; j < N; j++) { | ||
int ac = 1; | ||
for (int k = 0; k < M; k++) { | ||
// printf("i=%d j=%d S[i][k]=%c S[j][k]=%c\n", i, j, S[i][k], S[j][k]); | ||
if (S[i][k] != 'o' && S[j][k] != 'o') { | ||
ac = 0; | ||
break; | ||
} | ||
} | ||
if (ac == 1) | ||
ans++; | ||
} | ||
|
||
} | ||
printf("%d\n", ans); | ||
// unsigned char i = 0xff; | ||
|
||
return (0); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#include <stdio.h> | ||
|
||
int main(void) | ||
{ | ||
int N; | ||
|
||
scanf("%d", &N); | ||
char S[N]; | ||
scanf("%s", S); | ||
// printf("N=%d S=%s\n", N, S); | ||
|
||
int is_convert = 1; | ||
for (int i = 0; i < N; i++) { | ||
if (S[i] == '"' && is_convert == 1) | ||
is_convert = 0; | ||
else if (S[i] == '"' && is_convert == 0) | ||
is_convert = 1; | ||
|
||
if (S[i] == ',' && is_convert == 1) | ||
S[i] = '.'; | ||
} | ||
printf("%s\n", S); | ||
|
||
|
||
return (0); | ||
} |