結果
| 問題 | No.688 E869120 and Constructing Array 2 |
| コンテスト | |
| ユーザー |
👑 |
| 提出日時 | 2026-10-18 18:02:45 |
| 言語 | C# (.NET 10.0.402 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 39 ms / 1,000 ms |
| + 972µs | |
| コード長 | 855 bytes |
| 記録 | |
| コンパイル時間 | 13,845 ms |
| コンパイル使用メモリ | 172,976 KB |
| 実行使用メモリ | 32,416 KB |
| 最終ジャッジ日時 | 2026-10-18 18:03:02 |
| 合計ジャッジ時間 | 8,598 ms |
|
ジャッジサーバーID (参考情報) |
judge6_0 / judge5_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 10 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.csproj を復元しました (263 ミリ秒)。 main -> /home/judge/data/code/bin/Release/net10.0/main.dll main -> /home/judge/data/code/bin/Release/net10.0/publish/
ソースコード
using System;
using static System.Console;
using System.Linq;
using System.Collections.Generic;
class Program
{
static int NN => int.Parse(ReadLine());
static int[] NList => ReadLine().Split().Select(int.Parse).ToArray();
public static void Main()
{
Solve();
}
static void Solve()
{
var k = NN;
for (var i = 0; i <= 30; ++i) for (var j = Math.Max(0, 1 - i); i + j <= 30; ++j)
{
var v = (long)j * (j - 1) / 2 << i;
if (v == k)
{
var ans = new List<int>();
for (var x = 0; x < i; ++x) ans.Add(0);
for (var x = 0; x < j; ++x) ans.Add(1);
WriteLine(ans.Count);
WriteLine(string.Join(" ", ans));
return;
}
}
}
}