結果
| 問題 |
No.64 XORフィボナッチ数列
|
| コンテスト | |
| ユーザー |
tatuyan_edson
|
| 提出日時 | 2015-05-22 00:29:17 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 324 bytes |
| コンパイル時間 | 92 ms |
| コンパイル使用メモリ | 21,376 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-07-06 04:25:00 |
| 合計ジャッジ時間 | 551 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 1 WA * 10 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:7:14: warning: format ‘%u’ expects argument of type ‘unsigned int *’, but argument 2 has type ‘long long unsigned int *’ [-Wformat=]
7 | scanf("%I64u%I64u%I64u",&F0,&F1,&N);
| ~~~~^ ~~~
| | |
| | long long unsigned int *
| unsigned int *
| %I64llu
main.c:7:19: warning: format ‘%u’ expects argument of type ‘unsigned int *’, but argument 3 has type ‘long long unsigned int *’ [-Wformat=]
7 | scanf("%I64u%I64u%I64u",&F0,&F1,&N);
| ~~~~^ ~~~
| | |
| | long long unsigned int *
| unsigned int *
| %I64llu
main.c:7:24: warning: format ‘%u’ expects argument of type ‘unsigned int *’, but argument 4 has type ‘long long unsigned int *’ [-Wformat=]
7 | scanf("%I64u%I64u%I64u",&F0,&F1,&N);
| ~~~~^ ~~
| | |
| | long long unsigned int *
| unsigned int *
| %I64llu
main.c:17:15: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 2 has type ‘long long unsigned int’ [-Wformat=]
17 | printf("%I64u\n",ans);
| ~~~~^ ~~~
| | |
| | long long unsigned int
| unsigned int
| %I64llu
main.c:7:3: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
7 | scanf("%I64u%I64u%I64u",&F0,&F1,&N);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include<stdio.h>
int main(void){
unsigned long long F0,F1,N,ans=0;
unsigned long long i,j,k;
scanf("%I64u%I64u%I64u",&F0,&F1,&N);
for(i=0;i<64;i++){
j=(F0>>i)&1;
k=(F1>>i)&1;
if(j)
ans+=(k?(N%3!=2):(N%3!=1))<<i;
else
ans+=(k?(N%3!=0):0)<<i;
}
printf("%I64u\n",ans);
return 0;
}
tatuyan_edson