ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1644. A Whole Lot of Walnuts

My AC
Posted by TUITUF_Temurbek 29 Aug 2013 12:41
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
Posted by Ivan Metelev 17 Jun 2015 13:14
Delete your code, please