結果
問題 | No.949 飲酒プログラミングコンテスト |
ユーザー | りあん |
提出日時 | 2019-12-05 23:00:32 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 3,001 bytes |
コンパイル時間 | 962 ms |
コンパイル使用メモリ | 113,716 KB |
実行使用メモリ | 28,412 KB |
最終ジャッジ日時 | 2024-06-24 02:36:26 |
合計ジャッジ時間 | 4,379 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 31 ms
25,196 KB |
testcase_01 | AC | 31 ms
27,168 KB |
testcase_02 | AC | 31 ms
24,988 KB |
testcase_03 | WA | - |
testcase_04 | AC | 31 ms
25,320 KB |
testcase_05 | AC | 32 ms
25,456 KB |
testcase_06 | AC | 31 ms
25,132 KB |
testcase_07 | AC | 31 ms
27,236 KB |
testcase_08 | WA | - |
testcase_09 | WA | - |
testcase_10 | AC | 35 ms
23,608 KB |
testcase_11 | WA | - |
testcase_12 | WA | - |
testcase_13 | WA | - |
testcase_14 | WA | - |
testcase_15 | AC | 72 ms
25,840 KB |
testcase_16 | AC | 103 ms
24,116 KB |
testcase_17 | AC | 51 ms
27,588 KB |
testcase_18 | AC | 160 ms
26,088 KB |
testcase_19 | AC | 86 ms
25,968 KB |
testcase_20 | AC | 46 ms
25,712 KB |
testcase_21 | AC | 39 ms
25,576 KB |
testcase_22 | AC | 43 ms
25,712 KB |
testcase_23 | AC | 36 ms
25,708 KB |
testcase_24 | AC | 100 ms
26,356 KB |
testcase_25 | WA | - |
testcase_26 | WA | - |
testcase_27 | AC | 110 ms
26,092 KB |
testcase_28 | AC | 170 ms
28,004 KB |
testcase_29 | AC | 112 ms
26,288 KB |
testcase_30 | WA | - |
testcase_31 | AC | 78 ms
25,964 KB |
testcase_32 | WA | - |
コンパイルメッセージ
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.Generic; using System.Linq; using System.IO; using System.Threading; using static util; class Program { static void Main(string[] args) { var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false }; var solver = new Solver(sw); // var t = new Thread(solver.solve, 1 << 26); // 64 MB // t.Start(); // t.Join(); solver.solve(); sw.Flush(); } } class Solver { StreamWriter sw; Scan sc; void Prt(string a) => sw.WriteLine(a); void Prt<T>(IEnumerable<T> a) => Prt(string.Join(" ", a)); void Prt(params object[] a) => Prt(string.Join(" ", a)); public Solver(StreamWriter sw) { this.sw = sw; this.sc = new Scan(); } public void solve() { int n = sc.Int; var a = sc.IntArr; var b = sc.IntArr; var d = sc.IntArr; Array.Sort(d); int max = n; while (max > 0 && d[max - 1] > Math.Max(a[0] + b[1], a[1] + b[0])) --max; int ans = 0; for (int i = 0; i <= n; i++) { int k = n; for (int j = 0; j <= n; j++) { while (k > 0 && d[k - 1] > a[i] + b[j]) --k; if (k > 0) ans = Math.Max(ans, Math.Min(i + j, max)); } } Prt(ans); } } static class util { public static readonly int M = 1000000007; } class Scan { StreamReader sr; public Scan() { sr = new StreamReader(Console.OpenStandardInput()); } public Scan(string path) { sr = new StreamReader(path); } public int Int => int.Parse(Str); public long Long => long.Parse(Str); public double Double => double.Parse(Str); public string Str => sr.ReadLine().Trim(); public int[] IntArr => StrArr.Select(int.Parse).ToArray(); public long[] LongArr => StrArr.Select(long.Parse).ToArray(); public double[] DoubleArr => StrArr.Select(double.Parse).ToArray(); public string[] StrArr => Str.Split(new[]{' '}, StringSplitOptions.RemoveEmptyEntries); bool eq<T, U>() => typeof(T).Equals(typeof(U)); T ct<T, U>(U a) => (T)Convert.ChangeType(a, typeof(T)); T cv<T>(string s) => eq<T, int>() ? ct<T, int>(int.Parse(s)) : eq<T, long>() ? ct<T, long>(long.Parse(s)) : eq<T, double>() ? ct<T, double>(double.Parse(s)) : eq<T, char>() ? ct<T, char>(s[0]) : ct<T, string>(s); public void Multi<T>(out T a) => a = cv<T>(Str); public void Multi<T, U>(out T a, out U b) { var ar = StrArr; a = cv<T>(ar[0]); b = cv<U>(ar[1]); } public void Multi<T, U, V>(out T a, out U b, out V c) { var ar = StrArr; a = cv<T>(ar[0]); b = cv<U>(ar[1]); c = cv<V>(ar[2]); } public void Multi<T, U, V, W>(out T a, out U b, out V c, out W d) { var ar = StrArr; a = cv<T>(ar[0]); b = cv<U>(ar[1]); c = cv<V>(ar[2]); d = cv<W>(ar[3]); } }