結果
| 問題 | 
                            No.1930 XOR of Two Range
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2022-05-07 03:00:57 | 
| 言語 | C++14  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 255 ms / 2,000 ms | 
| コード長 | 240 bytes | 
| コンパイル時間 | 465 ms | 
| コンパイル使用メモリ | 65,728 KB | 
| 実行使用メモリ | 6,944 KB | 
| 最終ジャッジ日時 | 2024-07-06 06:49:35 | 
| 合計ジャッジ時間 | 2,224 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge1 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 1 | 
| other | AC * 3 | 
コンパイルメッセージ
main.cpp:5:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    5 | main()
      | ^~~~
            
            ソースコード
#include<iostream>
using namespace std;
int T;
long L,R;
main()
{
	cin>>T;
	for(;T--;)
	{
		cin>>L>>R;
		if((L+R)%2==1)
		{
			cout<<((L+R)/2-L+2)/2%2<<endl;
		}
		else
		{
			cout<<(((L+R)/2-L+1)%2*(L+R)^((L+R)/2-L+1)/2%2)<<endl;
		}
	}
}