結果
| 問題 |
No.64 XORフィボナッチ数列
|
| コンテスト | |
| ユーザー |
Tatsu_mr
|
| 提出日時 | 2024-10-10 22:09:47 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 750 bytes |
| コンパイル時間 | 3,084 ms |
| コンパイル使用メモリ | 245,304 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-10-10 22:09:52 |
| 合計ジャッジ時間 | 3,844 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 1 WA * 10 |
ソースコード
#include <bits/stdc++.h>
#define rep(i, n) for(long long i = 0; i < n; i++)
#define ALL(v) (v).begin(), (v).end()
#define rALL(v) (v).rbegin(), (v).rend()
using namespace std;
using lint = long long;
int main() {
lint f0, f1, n;
cin >> f0 >> f1 >> n;
lint ans = 0;
rep(i, 61) {
lint x = (f0 & (1 << i) ? 1 : 0), y = (f1 & (1 << i) ? 1 : 0);
if (x == 0 && y == 1) {
if (n % 3 != 0) {
ans |= (1 << i);
}
} else if (x == 1 && y == 0) {
if (n % 3 != 1) {
ans |= (1 << i);
}
} else if (x == 1 && y == 1) {
if (n % 3 != 2) {
ans |= (1 << i);
}
}
}
cout << ans << endl;
}
Tatsu_mr