|
|
back to boardMy AC import java.util.Scanner; public class T_1644 { public static void main(String[] args) { Scanner sc= new Scanner(System.in); int n=sc.nextInt(); int min=10; int max=Integer.MIN_VALUE; for (int i = 0; i < n; i++) { int x=sc.nextInt(); String s=sc.next(); if(s.equals("hungry"))max=Math.max(x, max); else min=Math.min(min,x); } if(max<min) System.out.println(min); else System.out.println("Inconsistent"); } } Re: My AC Delete your code, please |
|
|