結果
問題 |
No.3155 Same Birthday
|
ユーザー |
![]() |
提出日時 | 2025-08-27 17:00:07 |
言語 | Java (openjdk 23) |
結果 |
TLE
|
実行時間 | - |
コード長 | 716 bytes |
コンパイル時間 | 2,180 ms |
コンパイル使用メモリ | 77,372 KB |
実行使用メモリ | 67,092 KB |
最終ジャッジ日時 | 2025-08-27 17:00:16 |
合計ジャッジ時間 | 8,339 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 2 |
other | AC * 1 TLE * 1 -- * 47 |
ソースコード
import java.util.*; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int n = scan.nextInt(); List<String> birthday = new ArrayList<String>(); boolean flg = false; CheckDay check = new CheckDay(); for(int i = 0 ; i < n ; i++){ String day = scan.nextLine(); if(check.CheckDay(birthday,day)){ flg = true; break; }else{ birthday.add(day); } } if(flg){ System.out.println("Yes"); }else{ System.out.println("No"); } } } class CheckDay{ boolean CheckDay(List<String> birthday , String day){ if(birthday.size() > 0 && birthday.indexOf(day) != -1){ return true; }else{ return false; } } }