슈콩

[SWEA] 태혁이의 사랑은 타이밍 본문

Algorithms/SWEA

[SWEA] 태혁이의 사랑은 타이밍

shukong 2025. 11. 14. 14:36

 

 

[문제]

https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AWLv6mx6htoDFAVV

 

SW Expert Academy

SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요!

swexpertacademy.com

 

 

[소스 코드]

import java.io.*;
import java.util.*;
public class Solution {
	public static void main(String[] args) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st;
		int T = Integer.parseInt(br.readLine());
		for(int tc=1;tc<=T;tc++) {
			st = new StringTokenizer(br.readLine());
			int d = Integer.parseInt(st.nextToken());
			int h = Integer.parseInt(st.nextToken());
			int m = Integer.parseInt(st.nextToken());
			int base = 11*24*60 + 11*60 + 11;
			int cmp = d*24*60 + h*60 + m;
			int result = cmp - base;
			if(result<0) {
				System.out.println("#"+tc+" -1");
			}
			else {
				System.out.println("#"+tc+" "+result);
			}
		}
	}
}

'Algorithms > SWEA' 카테고리의 다른 글

[SWEA] 5일차 - GNS  (0) 2025.11.14
[SWEA] 삼성시의 버스 노선  (0) 2025.11.14
[SWEA] 다트 게임  (0) 2025.11.14
[SWEA] 숫자가 같은 배수  (0) 2025.11.13
[SWEA] 상원이의 연속 합  (0) 2025.11.12