結果
問題 |
No.110 しましまピラミッド
|
ユーザー |
![]() |
提出日時 | 2014-12-23 23:46:00 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,371 bytes |
コンパイル時間 | 2,901 ms |
コンパイル使用メモリ | 115,232 KB |
実行使用メモリ | 26,460 KB |
最終ジャッジ日時 | 2024-06-12 04:28:59 |
合計ジャッジ時間 | 2,766 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 17 WA * 9 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System; using System.Collections; using System.Collections.Generic; class TEST{ static void Main(){ Sol mySol =new Sol(); mySol.Solve(); } } class Sol{ public void Solve(){ Array.Sort(A[0]); Array.Sort(A[1]); int[] P=new int[]{0,0}; int max=0; for(int i=0;i<2;i++){ int cnt=1; int turn=1-i; int now=A[i][0]; while(true){ if(P[turn]==A[turn].Length)break; if(A[turn][P[turn]]>now){ now=A[turn][P[turn]]; P[turn]++; cnt++; turn=1-turn; continue; } if(P[turn]<A[turn].Length){ P[turn]++; continue; } break; } max=Math.Max(cnt,max); } Console.WriteLine(max); } int N,M; int[][] A; public Sol(){ N=ri(); A=new int[2][]; A[0]=ria(); M=ri(); A[1]=ria(); } static String rs(){return Console.ReadLine();} static int ri(){return int.Parse(Console.ReadLine());} static long rl(){return long.Parse(Console.ReadLine());} static double rd(){return double.Parse(Console.ReadLine());} static String[] rsa(){return Console.ReadLine().Split(' ');} static int[] ria(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>int.Parse(e));} static long[] rla(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>long.Parse(e));} static double[] rda(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>double.Parse(e));} }