0

サンプル入力はこちら

Writing Fast Tests Against Enterprise Rails 60min
Overdoing it in Python 45min
Lua for the Masses 30min
Ruby Errors from Mismatched Gem Versions 45min
Common Ruby Errors 45min
Rails for Python Developers lightning
Communicating Over Distance 60min
Accounting-Driven Development 45min
Woah 30min
Sit Down and Write 30min
Pair Programming vs Noise 45min
Rails Magic 60min
Ruby on Rails: Why We Should Move On 60min
Clojure Ate Scala (on my project) 45min
Programming in the Boondocks of Seattle 30min
Ruby vs. Clojure for Back-End Development 30min
Ruby on Rails Legacy App Maintenance 60min
A World Without HackerNews 30min
User Interface CSS in Rails Apps 30min

上記の入力に対する出力:

Track 1:
09:00AM Writing Fast Tests Against Enterprise Rails 60min
10:00AM Overdoing it in Python 45min
10:45AM Lua for the Masses 30min
11:15AM Ruby Errors from Mismatched Gem Versions 45min
12:00PM Lunch
01:00PM Ruby on Rails: Why We Should Move On 60min
02:00PM Common Ruby Errors 45min
02:45PM Pair Programming vs Noise 45min
03:30PM Programming in the Boondocks of Seattle 30min
04:00PM Ruby vs. Clojure for Back-End Development 30min
04:30PM User Interface CSS in Rails Apps 30min
05:00PM Networking Event



Track 2:
09:00AM Communicating Over Distance 60min
10:00AM Rails Magic 60min
11:00AM Woah 30min
11:30AM Sit Down and Write 30min
12:00PM Lunch
01:00PM Accounting-Driven Development 45min
01:45PM Clojure Ate Scala (on my project) 45min
02:30PM A World Without HackerNews 30min
03:00PM Ruby on Rails Legacy App Maintenance 60min
04:00PM Rails for Python Developers lightning
05:00PM Networking Event

設計ルール:

• The conference has multiple tracks each of which has a morning and afternoon session.
• Each session contains multiple talks.
• Morning sessions begin at 9am and must finish by 12 noon, for lunch.
• Afternoon sessions begin at 1pm and must finish in time for the networking event.
• The networking event can start no earlier than 4:00 and no later than 5:00.
• No talk title has numbers in it.
• All talk lengths are either in minutes (not hours) or lightning (5 minutes).
• Presenters will be very punctual; there needs to be no gap between sessions.

実際に私がやったことは、

キーと値のペアを使用しました - ユーザーの入力を変更する

タスクをキーに、時間を値に保存します-キーまたは値を取得する方が簡単だと思いました

タスク出力リストの定義時

class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Enter your input:");
            Console.WriteLine("Type 'end' to finish");
            var _lstInput = new List<KeyValuePair<string, int>>();
            string _strValue = string.Empty;

            #region Gathering Input

            do
            {
                _strValue = Console.ReadLine();
                if (_strValue.ToLower() != "end")
                {
                    var _MinuteValue = _strValue.Split(' ').Where
                                        (
                                            i => (i.ToLower().Contains("min") || i.ToLower().Contains("lightning"))
                                        ).FirstOrDefault().Replace("min", string.Empty).Replace("lightning", "5");
                    if (_MinuteValue != null)
                    {
                        _lstInput.Add(new KeyValuePair<string, int>(_strValue, Convert.ToInt32(_MinuteValue)));
                    }
                }
            } while (_strValue.ToLower() != "end");

            #endregion

            int iTemp = _lstInput.Count();
            Console.ReadLine();
        }        
    }

私がしなければならないこと: セッションを中断せずにタスクを調整するにはどうすればよいですか? ただし、複数のトラックが存在する可能性がありますRules

4

1 に答える 1