結果
| 問題 | 
                            No.64 XORフィボナッチ数列
                             | 
                    
| コンテスト | |
| ユーザー | 
                             tatuyan_edson
                         | 
                    
| 提出日時 | 2015-05-22 00:25:56 | 
| 言語 | C90  (gcc 12.3.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 318 bytes | 
| コンパイル時間 | 105 ms | 
| コンパイル使用メモリ | 21,504 KB | 
| 実行使用メモリ | 6,948 KB | 
| 最終ジャッジ日時 | 2024-07-06 04:24:53 | 
| 合計ジャッジ時間 | 584 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge2 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 1 WA * 10 | 
コンパイルメッセージ
main.c: In function ‘main’:
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("%Lu%Lu%Lu",&F0,&F1,&N);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            
            ソースコード
#include<stdio.h>
int main(void){
  unsigned long long F0,F1,N,ans=0;
  unsigned long long i,j,k;
  scanf("%Lu%Lu%Lu",&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