ENG  RUS Timus Online Judge
Online Judge
Problems
Authors
Online contests
Site news
Webboard
Problem set
Submit solution
Judge status
Guide
Register
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

## Discussion of Problem 1510. Order

Help! TLE19. What's wrong?
Posted by Maxim Afripov 3 Nov 2021 23:29
using System;
using System.Collections.Generic;
namespace Order {
class Banknotes {
public long value = 0;
public int count = 0;
public Banknotes(long value) {
this.value = value;
}
}

class Program {
public static Banknotes FindMaxValue (List<Banknotes> list) {
int _maxValue = list[0].count;
Banknotes _maxBanknote = list[0];
for (int index = 1; index < list.Count; index++) {
if (list[index].count > _maxValue) {
_maxBanknote = list[index];
_maxValue = list[index].count;
}
}

return _maxBanknote;
}

public static void Main (string[] args) {
List<Banknotes> banknotes = new List<Banknotes>();
if (length == 0) return;

banknotes[0].count = 1;
for (int iterable = 1; iterable < length; iterable++) {
for (int jterable = 0; jterable < banknotes.Count; jterable++) {
// Console.WriteLine(\$"{number} is {numbers[jterable].value}?");
if (number == banknotes[jterable].value) {
banknotes[jterable].count++;
// Console.WriteLine("yes");
break;
} else if (jterable + 1 == banknotes.Count) {
// Console.WriteLine("no");