4624 | 2023-03-30 12:40:36 | Leventusz19 | Leghosszabb béke (75 pont) | csharp | Forditási hiba |
using System;using System.Linq;using System.Threading.Tasks;class Program{static void Main(string[] args){int[] I=Console.ReadLine().Split().Select(int.Parse).ToArray();bool[] D=new bool[I[0]];Parallel.For(0,I[1],i=>{int[] in2=Console.ReadLine().Split().Select(int.Parse).ToArray();Enumerable.Range(in2[0],in2[1]-in2[0]+1).ForEach(j=>D[j-1]=true);});int o=0;int[] om={0,0};for(int i=0;i<I[0];i++){if(!D[i])o++;else o=0;if(o>om[0]){om[0]=o;om[1]=i;}}Console.WriteLine((om[0])+" "+(om[1]+2-om[0]));Console.ReadKey();}}
exit status 1
Compilation failed: 1 error(s), 0 warnings
main.cs(1,255+): error CS1061: Type `System.Collections.Generic.IEnumerable<int>' does not contain a definition for `ForEach' and no extension method `ForEach' of type `System.Collections.Generic.IEnumerable<int>' could be found. Are you missing an assembly reference?
/usr/lib/mono/4.5/mscorlib.dll (Location of the symbol related to previous error)
Exited with error status 1