제출 #331332

#제출 시각아이디문제언어결과실행 시간메모리
331332anishrajeev무제 (POI11_tem)Java
8 / 100
644 ms44212 KiB
import java.io.*; import java.util.*; public class tem { public static void main(String[] args) throws IOException { BufferedReader bf = new BufferedReader(new InputStreamReader(System.in)); //BufferedReader bf = new BufferedReader(new FileReader("tester.in")); PrintWriter pw = new PrintWriter(new OutputStreamWriter(System.out)); int N = Integer.parseInt(bf.readLine()); int[] min = new int[N]; int[] max = new int[N]; /*for(int i = 0; i < N; i++){ StringTokenizer stk = new StringTokenizer(bf.readLine()); min[i] = Integer.parseInt(stk.nextToken()); max[i] = Integer.parseInt(stk.nextToken()); }*/ int num = Integer.MIN_VALUE; int count = 0; int answer = 0; int mins = 0; int maxs = 0; boolean read = true; for(int i = 0; i < N; i++){ if(read){ StringTokenizer stk = new StringTokenizer(bf.readLine()); mins = Integer.parseInt(stk.nextToken()); maxs = Integer.parseInt(stk.nextToken()); } read = true; if(mins>=num||maxs>=num){ count++; if(mins>=num)num = mins; else if(mins<=num&&num<=maxs)num = num; else num = maxs; } else{ num = mins; i--; answer = Math.max(answer, count); count=0; read = false; } } System.out.println(answer); } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...