結果

問題 No.64 XORフィボナッチ数列
ユーザー AdamantiteAdamantite
提出日時 2023-06-28 01:01:21
言語 C#
(.NET 8.0.203)
結果
TLE  
実行時間 -
コード長 772 bytes
コンパイル時間 6,805 ms
コンパイル使用メモリ 144,176 KB
実行使用メモリ 32,836 KB
最終ジャッジ日時 2023-09-17 23:46:16
合計ジャッジ時間 13,945 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 48 ms
30,284 KB
testcase_01 AC 49 ms
30,172 KB
testcase_02 AC 48 ms
28,104 KB
testcase_03 AC 48 ms
27,988 KB
testcase_04 AC 48 ms
27,972 KB
testcase_05 AC 48 ms
28,384 KB
testcase_06 AC 48 ms
28,232 KB
testcase_07 AC 50 ms
28,172 KB
testcase_08 AC 50 ms
30,416 KB
testcase_09 TLE -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
  Determining projects to restore...
  Restored /home/judge/data/code/main.csproj (in 120 ms).
.NET 向け Microsoft (R) Build Engine バージョン 17.0.0-preview-21470-01+cb055d28f
Copyright (C) Microsoft Corporation.All rights reserved.

  プレビュー版の .NET を使用しています。https://aka.ms/dotnet-core-preview をご覧ください
  main -> /home/judge/data/code/bin/Release/net6.0/main.dll
  main -> /home/judge/data/code/bin/Release/net6.0/publish/

ソースコード

diff #

using System;

namespace No64_XORFibonacciSequence
{
    internal class Program
    {
        static void Main(string[] args) {
            string[] param = Console.ReadLine().Split(' ');
            long f0 = long.Parse(param[0]);
            long f1 = long.Parse(param[1]);
            long n = long.Parse(param[2]);

            if(n == 0) {
                Console.WriteLine(f0);
                return;
            }else if(n == 1) {
                Console.WriteLine(f1);
                return;
            }

            long fk1 = f1;
            long fk2 = f0;
            for(long i = 2; i <= n; i++) {
                long fk = fk1 ^ fk2;
                fk2 = fk1;
                fk1 = fk;
            }
            Console.WriteLine(fk1);
        }
    }
}
0