Language: C++

using System;
using System.IO;
using System.Linq;
using System.Collections.Generic;
using System.Text;
using System.Numerics;

namespace dpc
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.SetOut(new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false });
            if (File.Exists("input.txt"))
            {
                Console.SetIn(new StreamReader("input.txt"));
            }
			solve_dpcA();
			Console.Out.Flush();
        }

        public static void solve_dpcB()
        {
        }

        public static void solve_dpcA()
        {
            int n = Convert.ToInt32(Console.ReadLine());
            int[] h = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
            int[] dp = new int[n];
            dp[0] = 0;
            dp[1] = Math.Abs(h[0] - h[1]);
            for (int i = 2; i < n; i++)
            {
                dp[i] = Math.Min(Math.Abs(h[i - 1] - h[i] + dp[i - 1]), Math.Abs(h[i - 2] - h[i]) + dp[i - 2]);
            }
            Console.WriteLine(dp[n - 1]);
        }
    }
}


Compiler output:
a.cc:1:7: error: expected nested-name-specifier before 'System'
    1 | using System;
      |       ^~~~~~
a.cc:2:7: error: expected nested-name-specifier before 'System'
    2 | using System.IO;
      |       ^~~~~~
a.cc:3:7: error: expected nested-name-specifier before 'System'
    3 | using System.Linq;
      |       ^~~~~~
a.cc:4:7: error: expected nested-name-specifier before 'System'
    4 | using System.Collections.Generic;
      |       ^~~~~~
a.cc:5:7: error: expected nested-name-specifier before 'System'
    5 | using System.Text;
      |       ^~~~~~
a.cc:6:7: error: expected nested-name-specifier before 'System'
    6 | using System.Numerics;
      |       ^~~~~~
a.cc:12:26: error: 'string' has not been declared
   12 |         static void Main(string[] args)
      |                          ^~~~~~
a.cc:12:35: error: expected ',' or '...' before 'args'
   12 |         static void Main(string[] args)
      |                                   ^~~~
a.cc:23:15: error: expected ':' before 'static'
   23 |         public static void solve_dpcB()
      |               ^~~~~~~
      |               :
a.cc:27:15: error: expected ':' before 'static'
   27 |         public static void solve_dpcA()
      |               ^~~~~~~
      |               :
a.cc:40:6: error: expected ';' after class definition
   40 |     }
      |      ^
      |      ;
a.cc: In static member function 'static void dpc::Program::Main(int*)':
a.cc:14:13: error: 'Console' was not declared in this scope
   14 |             Console.SetOut(new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false });
      |             ^~~~~~~
a.cc:14:32: error: expected type-specifier before 'StreamWriter'
   14 |             Console.SetOut(new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false });
      |                                ^~~~~~~~~~~~
a.cc:15:17: error: 'File' was not declared in this scope
   15 |             if (File.Exists("input.txt"))
      |                 ^~~~
a.cc:17:35: error: expected type-specifier before 'StreamReader'
   17 |                 Console.SetIn(new StreamReader("input.txt"));
      |                                   ^~~~~~~~~~~~
a.cc: In static member function 'static void dpc::Program::solve_dpcA()':
a.cc:29:21: error: 'Convert' was not declared in this scope
   29 |             int n = Convert.ToInt32(Console.ReadLine());
      |                     ^~~~~~~
a.cc:29:37: error: 'Console' was not declared in this scope
   29 |             int n = Convert.ToInt32(Console.ReadLine());
      |                                     ^~~~~~~
a.cc:30:16: error: structured binding declaration cannot have type 'int'
   30 |             int[] h = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
      |                ^~
a.cc:30:16: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:30:16: error: empty structured binding declaration
a.cc:30:19: error: expected initializer before 'h'
   30 |             int[] h = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
      |                   ^
a.cc:31:16: error: structured binding declaration cannot have type 'int'
   31 |             int[] dp = new int[n];
      |                ^~
a.cc:31:16: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:31:16: error: empty structured binding declaration
a.cc:31:19: error: expected initializer before 'dp'
   31 |             int[] dp = new int[n];
      |                   ^~
a.cc:32:13: error: 'dp' was not declared in this scope; did you mean 'dpc'?
   32 |             dp[0] = 0;
      |             ^~
      |             dpc
a.cc:33:21: error: 'Math' was not declared in this scope
   33 |             dp[1] = Math.Abs(h[0] - h[1]);
      |                     ^~~~
a.cc:33:30: error: 'h' was not declared in this scope
   33 |             dp[1] = Math.Abs(h[0] - h[1]);
      |                              ^