結果
| 問題 |
No.64 XORフィボナッチ数列
|
| コンテスト | |
| ユーザー |
TAKEKATSU
|
| 提出日時 | 2019-03-20 17:47:59 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 958 bytes |
| コンパイル時間 | 1,590 ms |
| コンパイル使用メモリ | 165,588 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-09-19 00:46:47 |
| 合計ジャッジ時間 | 2,233 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 1 WA * 10 |
コンパイルメッセージ
main.cpp: In function 'long long int gcd(long long int, long long int)':
main.cpp:30:11: warning: control reaches end of non-void function [-Wreturn-type]
30 | else gcd(b, a%b);
| ~~~^~~~~~~~
ソースコード
#include "bits/stdc++.h"
using namespace std;
#define ll long long
#define vi vector<int>
#define vvi vector<vi>
#define pi pair<int,int>
#define mp make_pair
#define pb push_back
#define MOD 1e9 + 7
#define PAI 3.1415
#define all(x) (x).begin(),(x).end()
#define chmax(x,y) x = max(x,y)
#define chmin(x,y) x = min(x,y)
#define pr(x) cout << x << endl
#define Endl endl
#define rep(i,n) for(int i = 0 ; i < n; i++)
const int dx[4] = {1,0,-1,0};
const int dy[4] = {0,1,0,-1};
const int ddx[8] = {-1,0,1,-1,1,-1,0,1};
const int ddy[8] = {-1,-1,-1,0,0,1,1,1};
const int inf = 99999999;
const ll linf = 1LL << 62;
ll gcd(ll a,ll b){
if(a < b)swap(a , b);
if(a % b == 0) return b;
else gcd(b, a%b);
}
ll lcm(ll a,ll b){
if(a < b)swap(a , b);
return (a/gcd(a , b)) * b;
}
int main(){
int f0, f1, f2, n; cin >> f0 >> f1 >> n;
f2 = f0 ^ f1;
if(n % 3 == 0)
pr(f0);
else if(n % 3 ==1)
pr(f1);
else
pr(f2);
return 0;
}
TAKEKATSU