반응형

백준 15700번 타일 채우기 4 풀이 코드

C | C++ | Java | Python


풀이

가로 x, 세로 y의 벽에는 두 칸짜리 타일을 x*y/2 개 채울 수 있습니다.

코드

#include <stdio.h>

int main(){
    long x, y;
    scanf("%ld %ld", &x, &y);
    printf("%ld", x * y / 2);
    return 0;
}
#include <iostream>
using namespace std;

int main(){
    long x, y;
    cin>>x>>y;
    cout<<x * y / 2;
    return 0;
}
import java.util.Scanner;

public class Main{
    public static void main(String[] args){                        
        Scanner sc = new Scanner(System.in);        
        long x = sc.nextLong(), y = sc.nextLong();
        System.out.println(x * y / 2);
    }
}
x, y = map(int, input().split())
print(x * y // 2)

문제 출처

https://www.acmicpc.net/problem/15700

반응형

+ Recent posts