結果
問題 |
No.64 XORフィボナッチ数列
|
ユーザー |
|
提出日時 | 2020-04-29 20:16:43 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 519 bytes |
コンパイル時間 | 4,067 ms |
コンパイル使用メモリ | 105,600 KB |
実行使用メモリ | 18,944 KB |
最終ジャッジ日時 | 2024-11-29 17:36:54 |
合計ジャッジ時間 | 4,578 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 7 RE * 4 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System; using System.Text; using System.Collections.Generic; using System.Linq; class Program { static void Main() { long[] n = Console.ReadLine().Split().Select(a => long.Parse(a)).ToArray(); long l = n[2] + 1; if(l < 2) l = 2; long[] list = new long[l]; list[0] = n[0]; list[1] = n[1]; for(long i = 2; i < l; i++) { list[i] = list[i - 2] ^ list[i - 1]; } Console.WriteLine($"{list[n[2]]}"); } }