From 6a49b56c5349ec264ba1259877c2596be380c3d7 Mon Sep 17 00:00:00 2001 From: songyc macbook Date: Mon, 2 Feb 2026 21:09:37 +0900 Subject: [PATCH] baekjoon 20260202 --- code_study/Baekjoon/c/14489.c | 11 +++ code_study/Baekjoon/swift/16946.swift | 98 +++++++++++++++++++++++++++ 2 files changed, 109 insertions(+) create mode 100644 code_study/Baekjoon/c/14489.c create mode 100644 code_study/Baekjoon/swift/16946.swift diff --git a/code_study/Baekjoon/c/14489.c b/code_study/Baekjoon/c/14489.c new file mode 100644 index 0000000..e012467 --- /dev/null +++ b/code_study/Baekjoon/c/14489.c @@ -0,0 +1,11 @@ +#include + +int a,b,c; + +int main() { + scanf("%d %d %d",&a, &b, &c); + + printf("%d\n",(a+b >= 2*c) ? (a+b)-2*c : a+b); + + return 0; +} \ No newline at end of file diff --git a/code_study/Baekjoon/swift/16946.swift b/code_study/Baekjoon/swift/16946.swift new file mode 100644 index 0000000..bba3088 --- /dev/null +++ b/code_study/Baekjoon/swift/16946.swift @@ -0,0 +1,98 @@ +func solve() { + guard let input1 = readLine() else { return } + let NM = input1.split(separator: " ").compactMap{Int($0)} + guard NM.count == 2 else { return } + let N = NM[0], M = NM[1] + + var field: [[Int]] = [] + for i in 0..