20250609 baekjoon C
This commit is contained in:
parent
be5ac07e94
commit
bfb233b4a3
26
code_study/Baekjoon/c/1193.c
Normal file
26
code_study/Baekjoon/c/1193.c
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
int main(){
|
||||||
|
int X;
|
||||||
|
scanf("%d",&X);
|
||||||
|
|
||||||
|
int line=1, line_max=1, denum;
|
||||||
|
do{
|
||||||
|
if(X>line_max){
|
||||||
|
line_max+=line+1;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
if(line%2){
|
||||||
|
denum = line-(line_max-X);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
denum = line_max-X+1;
|
||||||
|
}
|
||||||
|
printf("%d/%d",line-denum+1, denum);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}while(line++);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
}
|
||||||
18
code_study/Baekjoon/c/2292.c
Normal file
18
code_study/Baekjoon/c/2292.c
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
int main(){
|
||||||
|
int N, res=0, max_value=1;
|
||||||
|
scanf("%d",&N);
|
||||||
|
|
||||||
|
while(++res){
|
||||||
|
if(max_value<N){
|
||||||
|
max_value += res*6;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
printf("%d",res);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
18
code_study/Baekjoon/c/2720.c
Normal file
18
code_study/Baekjoon/c/2720.c
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
int main(){
|
||||||
|
int t, c;
|
||||||
|
int coin[4] = {25,10,5,1};
|
||||||
|
scanf("%d",&t);
|
||||||
|
|
||||||
|
while(t--){
|
||||||
|
scanf("%d",&c);
|
||||||
|
for(int i=0; i<4; i++){
|
||||||
|
printf("%d ",c/coin[i]);
|
||||||
|
c%=coin[i];
|
||||||
|
}
|
||||||
|
printf("\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
13
code_study/Baekjoon/c/2869.c
Normal file
13
code_study/Baekjoon/c/2869.c
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
int main(){
|
||||||
|
int a,b,v,days;
|
||||||
|
scanf("%d %d %d",&a,&b,&v);
|
||||||
|
|
||||||
|
days = (v-a)/(a-b) + 1;
|
||||||
|
if((v-a)%(a-b)!=0) days++;
|
||||||
|
|
||||||
|
printf("%d",days);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
9
code_study/Baekjoon/c/2903.c
Normal file
9
code_study/Baekjoon/c/2903.c
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
int main(){
|
||||||
|
int N;
|
||||||
|
scanf("%d",&N);
|
||||||
|
printf("%d",((1<<N)+1)*((1<<N)+1));
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user