mirror of
https://github.com/tiennm99/codeforces.git
synced 2026-10-14 16:17:09 +00:00
[Init] Solved solutions
This commit is contained in:
1 parent
51f667ac81
commit
20542601dd
131 files changed
+4148
No files matched your search
+28
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
|
||||
namespace problem_1005A
|
||||
{
|
||||
class problem_1005A
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
int n = int.Parse(Console.ReadLine());
|
||||
int[] a = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
|
||||
ArrayList b = new ArrayList();
|
||||
for (int i = 0; i < n - 1; i++)
|
||||
{
|
||||
if (a[i + 1] == 1)
|
||||
{
|
||||
b.Add(a[i]);
|
||||
}
|
||||
}
|
||||
b.Add(a[n - 1]);
|
||||
Console.WriteLine(b.Count);
|
||||
foreach (var t in b)
|
||||
{
|
||||
Console.Write("{0} ", t);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user