提出 #68524673


ソースコード 拡げる

using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
#pragma warning disable CS8603, CS8604, CS8602


namespace ProblemB {
	class TEST {
		public static void Main() {
			Sol mySol = new Sol();
			mySol.Solve();
		}
	}

	class Sol {
		public void Solve() {
			List<int> a = new List<int>();
			foreach(var q in Query){
				switch(q[0]){
					case 1:
						a.Add(q[1]);
						break;
					case 2:
						a.Sort();
						a.Reverse();
						Console.WriteLine(a[a.Count - 1]);
						a.RemoveAt(a.Count - 1);
						break;
					default:
						throw new Exception("Invalid query type");
				}
			}

		}
		int Q;
		int[][] Query;
		public Sol() {
			Q = ri();
			Query = new int[Q][];
			for(int i=0;i<Q; i++) {
				Query[i] = 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(char sep = ' ') { return Console.ReadLine().Split(sep); }
		static int[] ria(char sep = ' ') { return Array.ConvertAll(Console.ReadLine().Split(sep), e => int.Parse(e)); }
		static long[] rla(char sep = ' ') { return Array.ConvertAll(Console.ReadLine().Split(sep), e => long.Parse(e)); }
		static double[] rda(char sep = ' ') { return Array.ConvertAll(Console.ReadLine().Split(sep), e => double.Parse(e)); }
		static T[] mka<T>(int n, T ini) { T[] ret = new T[n]; for (int i = 0; i < n; i++) ret[i] = ini; return ret; }
		static T[][] mka<T>(int n, int m, T ini) { T[][] ret = new T[n][]; for (int i = 0; i < n; i++) ret[i] = mka(m, ini); return ret; }
		static T[][][] mka<T>(int n, int m, int l, T ini) { T[][][] ret = new T[n][][]; for (int i = 0; i < n; i++) ret[i] = mka(m, l, ini); return ret; }
		static T[][][][] mka<T>(int n, int m, int l, int k, T ini) { T[][][][] ret = new T[n][][][]; for (int i = 0; i < n; i++) ret[i] = mka(m, l, k, ini); return ret; }
		static T[] mka<T>(int n) where T : new() { T[] ret = new T[n]; for (int i = 0; i < n; i++) ret[i] = new T(); return ret; }
		static T[][] mka<T>(int n, int m) where T : new() { T[][] ret = new T[n][]; for (int i = 0; i < n; i++) ret[i] = mka<T>(m); return ret; }
		static T[][][] mka<T>(int n, int m, int l) where T : new() { T[][][] ret = new T[n][][]; for (int i = 0; i < n; i++) ret[i] = mka<T>(m, l); return ret; }
		static T[][][][] mka<T>(int n, int m, int l, int k) where T : new() { T[][][][] ret = new T[n][][][]; for (int i = 0; i < n; i++) ret[i] = mka<T>(m, l, k); return ret; }

	}

}

提出情報

提出日時
問題 B - Get Min
ユーザ kuuso
言語 C# 11.0 (.NET 7.0.7)
得点 200
コード長 2687 Byte
結果 AC
実行時間 50 ms
メモリ 25488 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 200 / 200
結果
AC × 2
AC × 21
セット名 テストケース
Sample sample00.txt, sample01.txt
All sample00.txt, sample01.txt, testcase00.txt, testcase01.txt, testcase02.txt, testcase03.txt, testcase04.txt, testcase05.txt, testcase06.txt, testcase07.txt, testcase08.txt, testcase09.txt, testcase10.txt, testcase11.txt, testcase12.txt, testcase13.txt, testcase14.txt, testcase15.txt, testcase16.txt, testcase17.txt, testcase18.txt
ケース名 結果 実行時間 メモリ
sample00.txt AC 39 ms 25056 KiB
sample01.txt AC 39 ms 24976 KiB
testcase00.txt AC 50 ms 24992 KiB
testcase01.txt AC 37 ms 25488 KiB
testcase02.txt AC 37 ms 25252 KiB
testcase03.txt AC 41 ms 25044 KiB
testcase04.txt AC 42 ms 25280 KiB
testcase05.txt AC 36 ms 25000 KiB
testcase06.txt AC 34 ms 25092 KiB
testcase07.txt AC 41 ms 25184 KiB
testcase08.txt AC 47 ms 25224 KiB
testcase09.txt AC 46 ms 25020 KiB
testcase10.txt AC 35 ms 25248 KiB
testcase11.txt AC 41 ms 24984 KiB
testcase12.txt AC 46 ms 25312 KiB
testcase13.txt AC 43 ms 25296 KiB
testcase14.txt AC 40 ms 24976 KiB
testcase15.txt AC 47 ms 25232 KiB
testcase16.txt AC 36 ms 25052 KiB
testcase17.txt AC 37 ms 25012 KiB
testcase18.txt AC 34 ms 25300 KiB