목록분류 전체보기 (140)
시배's Android
5549번: 행성 탐사 상근이는 우주선을 타고 인간이 거주할 수 있는 행성을 찾고 있다. 마침내, 전 세계 최초로 인간이 거주할 수 있는 행성을 찾았다. 이 행성은 정글, 바다, 얼음이 뒤얽힌 행성이다. 상근이는 이 www.acmicpc.net private fun main() { val sb = StringBuilder() val (n, m) = readLine()!!.split(" ").map{it.toInt()} val k = readLine()!!.toInt() val board = (1 .. n).map { readLine()!!.toList() } val prefixed = MutableList(n + 1) { MutableList(m + 1) { MutableList(3) { 0 } } } ..
3273번: 두 수의 합 n개의 서로 다른 양의 정수 a1, a2, ..., an으로 이루어진 수열이 있다. ai의 값은 1보다 크거나 같고, 1000000보다 작거나 같은 자연수이다. 자연수 x가 주어졌을 때, ai + aj = x (1 ≤ i a to b.size }.toMap() println(f.map{ (y, c) -> c.toLong() * f..
TdsText 컴포넌트 @Composable fun TdsText( modifier: Modifier = Modifier, text: String? = null, textStyle: TdsTextStyle, fontSize: TextUnit, textDecoration: TextDecoration? = null, color: TdsColor, textAlign: TextAlign? = null, overflow: TextOverflow = TextOverflow.Clip, maxLines: Int = Int.MAX_VALUE, minLines: Int = 1, onTextLayout: (TextLayoutResult) -> Unit = {}, ) { Text( text = text ?: "", modif..
폰트 설정 FontFamily를 사용하여 여러 가지 글꼴을 정의하고 있습니다. 예를 들어, hgggothicssiProFontFamily에는 여러 가지 두께의 글꼴이 포함되어 있습니다. 이를 사용하여 텍스트 스타일에서 해당 글꼴을 참조할 수 있습니다. val hgggothicssiProFontFamily = FontFamily( Font(R.font.hgggothicssi_pro_00g, FontWeight.Thin), Font(R.font.hgggothicssi_pro_20g, FontWeight.ExtraLight), Font(R.font.hgggothicssi_pro_40g, FontWeight.Normal), Font(R.font.hgggothicssi_pro_60g, FontWeight.Semi..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/EkANm/btsv7kHkd9k/Ho5bLxD1sTbKR6jTOVCKH1/img.png)
TiTi 프로젝트에서는 Timer와 StopWatch 기능을 구현하기 위해, 실제 시간이 흐르는 듯한 Animate Counter Timer를 구현해야 합니다. 이 과정은 앱의 핵심 부분 중 하나이며, 사용자에게 시간 경과를 시각적으로 제공하는 중요한 요소입니다. 블로그 글에서는 이 Animate Counter Timer의 구현 방법을 자세히 알아보겠습니다. 실제로 시, 분, 초가 흐르는 것처럼 보이는 놀라운 효과를 어떻게 만들 수 있는지, 코드와 함께 상세히 살펴보겠습니다. AnimatedCounter @Composable fun TdsAnimatedCounter( modifier: Modifier = Modifier, count: Int, ) { var oldCount by remember { mut..
Compose를 활용한 커스텀 테마 및 다크 모드 / 라이트 모드 대응 Jetpack Compose를 사용하면 Android 앱의 사용자 인터페이스를 구축할 때 커스텀 테마를 설정하고 다크 모드와 라이트 모드 간에 전환하는 기능을 쉽게 구현할 수 있습니다. 이 글에서는 커스텀 테마를 설정하고 다크 모드와 라이트 모드를 대응하는 방법을 알아보겠습니다. 커스텀 컬러 팔레트 정의 @Immutable data class CustomColorsPalette( val d1: Color = Color.Unspecified, val d2: Color = Color.Unspecified, // 다른 컬러들도 포함... val clearColor: Color = Color.Unspecified ) 먼저, 앱에서 사용할 커..
6443번: 애너그램 첫째 줄에 단어의 개수 N 이, 둘째 줄부터 N개의 영단어가 들어온다. 영단어는 소문자로 이루어져 있다. 단어의 길이는 20보다 작거나 같고, 애너그램의 수가 100,000개 이하인 단어만 입력으로 주 www.acmicpc.net private fun main() { fun dfs(alphabet: IntArray, length: Int, str: String) { if (str.length == length) { println(str) return } for (i in alphabet.indices) { if (alphabet[i] > 0) { alphabet[i]-- dfs(alphabet, length, str + (i + 'a'.code).toChar()) alphabet[i..
2553번: 마지막 팩토리얼 수 첫째 줄에 N이 주어진다. N은 20,000보다 작거나 같은 자연수 이다. www.acmicpc.net private fun main() { val n = readln().toInt() var result = 1L for (i in 1..n) { result *= i result %= 10000000 while (result % 10 == 0L) { result /= 10 } } println(result % 10) }