Submission #1114980
Source Code Expand
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Diagnostics; namespace VS_TopCoder { public class ANewHope { public int count(int[] firstWeek, int[] lastWeek, int D) { int N = firstWeek.Length; int shift = N - D; int ma = 1; for (int i = 0; i < N; i++) { for (int j = 0; j < N; j++) { if(firstWeek[i]==lastWeek[j] && j < i) { int d = i - j; ma = Math.Max(ma, (d + shift - 1) / shift + 1); } } } return ma; } } class Program { static void Main(string[] args) { Test(); var N = Convert.ToInt32(Console.ReadLine()); var mul = N / 15; int answer = mul * 15 * 800 - mul * 200; Console.WriteLine(answer); } static List<string> Readlines() { List<string> answer = new List<string>(); do { var item = Console.ReadLine(); if (item == null) { break; } else { answer.Add(item); } } while (true); return answer; } static List<string[]> Readlines2D(string divider) { List<string[]> answer = new List<string[]>(); do { var item = Console.ReadLine(); if (item == null) { break; } else { answer.Add(item.Split(Convert.ToChar(divider))); } } while (true); return answer; } //priority queue [Conditional("DEBUG")] static private void Test() { Console.SetIn(new System.IO.StreamReader(@"c:\users\user\documents\visual studio 2015\Projects\VS TopCoder\VS TopCoder\Test.txt")); } } class PriorityQueue<T> { private readonly List<T> heap; private readonly Comparison<T> compare; private int size; public PriorityQueue() : this(Comparer<T>.Default) { } public PriorityQueue(IComparer<T> comparer) : this(16, comparer.Compare) { } public PriorityQueue(Comparison<T> comparison) : this(16, comparison) { } public PriorityQueue(int capacity, Comparison<T> comparison) { heap = new List<T>(capacity); compare = comparison; } public void Enqueue(T item) { heap.Add(item); var i = size++; while (i > 0) { var p = (i - 1) >> 1; if (compare(this.heap[p], item) <= 0) break; this.heap[i] = heap[p]; i = p; } this.heap[i] = item; } public T Dequeue() { var ret = this.heap[0]; var x = this.heap[--size]; var i = 0; while ((i << 1) + 1 < size) { var a = (i << 1) + 1; var b = (i << 1) + 2; if (b < size && compare(heap[b], heap[a]) < 0) a = b; if (compare(heap[a], x) >= 0) break; heap[i] = heap[a]; i = a; } heap[i] = x; heap.RemoveAt(size); return ret; } public T Peek() { return heap[0]; } public int Count { get { return size; } } public bool Any() { return size > 0; } } }
Submission Info
Submission Time | |
---|---|
Task | A - Restaurant |
User | get_ageless |
Language | C# (Mono 4.6.2.0) |
Score | 0 |
Code Size | 4092 Byte |
Status | WA |
Exec Time | 21 ms |
Memory | 13268 KB |
Judge Result
Set Name | Sample | All | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 100 | ||||||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | 00_example_01.txt, 00_example_02.txt |
All | 00_example_01.txt, 00_example_02.txt, 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
00_example_01.txt | WA | 21 ms | 9172 KB |
00_example_02.txt | AC | 20 ms | 11220 KB |
01.txt | WA | 20 ms | 13268 KB |
02.txt | WA | 20 ms | 9172 KB |
03.txt | WA | 19 ms | 9172 KB |
04.txt | WA | 20 ms | 11220 KB |
05.txt | WA | 20 ms | 9172 KB |
06.txt | AC | 20 ms | 9172 KB |