fork download
  1. using System;
  2. using System.Text;
  3. using System.Xml.Serialization;
  4.  
  5. namespace read_xml
  6. {
  7. [Serializable]
  8. public class TreeNode
  9. {
  10. public int whoseMove;
  11. public TreeNode[] children;
  12. public int[] scores;
  13.  
  14. public TreeNode()
  15. {
  16. children = null;
  17. scores = null;
  18. }
  19.  
  20. }
  21.  
  22. class Program
  23. {
  24. static void Main(string[] args)
  25. {
  26. XmlSerializer serializer = new XmlSerializer(typeof(TreeNode));
  27. TreeNode root = (TreeNode) serializer.Deserialize(Console.In);
  28.  
  29. /*
  30.   Допишіть код.
  31.   Частково, тут.
  32.   Виведення відповіді (просто двох чисел в одному рядку через пробіл на екран)
  33.   напишіть самостійно.
  34.   Створювати інші методи класу Program та/або інші класи теж можна.
  35.   Один з авторських розв'язків передбачає, що дописати треба
  36.   приблизно 15 рядків, приблизно 500 байтів
  37.   (це при тому, що код написаний досить нормально, з нормальними довжинами ідентифікаторів)
  38.   */
  39.  
  40. }
  41. }
  42. }
  43.  
Success #stdin #stdout 0.17s 42736KB
stdin
<?xml version="1.0"?>
<TreeNode xmlns:xsi="http://w...content-available-to-author-only...3.org/2001/XMLSchema-instance" xmlns:xsd="http://w...content-available-to-author-only...3.org/2001/XMLSchema">
  <whoseMove>0</whoseMove>
  <children>
    <TreeNode>
      <whoseMove>1</whoseMove>
      <children>
        <TreeNode>
          <whoseMove>0</whoseMove>
          <children>
            <TreeNode>
              <whoseMove>1</whoseMove>
              <scores>
                <int>-12</int>
                <int>50</int>
              </scores>
            </TreeNode>
            <TreeNode>
              <whoseMove>1</whoseMove>
              <scores>
                <int>-10</int>
                <int>1</int>
              </scores>
            </TreeNode>
          </children>
        </TreeNode>
        <TreeNode>
          <whoseMove>0</whoseMove>
          <scores>
            <int>25</int>
            <int>20</int>
          </scores>
        </TreeNode>
      </children>
    </TreeNode>
    <TreeNode>
      <whoseMove>1</whoseMove>
      <children>
        <TreeNode>
          <whoseMove>0</whoseMove>
          <scores>
            <int>-4</int>
            <int>-2</int>
          </scores>
        </TreeNode>
        <TreeNode>
          <whoseMove>0</whoseMove>
          <scores>
            <int>1</int>
            <int>4</int>
          </scores>
        </TreeNode>
        <TreeNode>
          <whoseMove>0</whoseMove>
          <scores>
            <int>40</int>
            <int>-10</int>
          </scores>
        </TreeNode>
        <TreeNode>
          <whoseMove>0</whoseMove>
          <children>
            <TreeNode>
              <whoseMove>1</whoseMove>
              <scores>
                <int>10</int>
                <int>25</int>
              </scores>
            </TreeNode>
            <TreeNode>
              <whoseMove>1</whoseMove>
              <scores>
                <int>6</int>
                <int>-7</int>
              </scores>
            </TreeNode>
          </children>
        </TreeNode>
      </children>
    </TreeNode>
    <TreeNode>
      <whoseMove>1</whoseMove>
      <scores>
        <int>-3</int>
        <int>-2</int>
      </scores>
    </TreeNode>
  </children>
</TreeNode>
stdout
Standard output is empty