結果

問題 No.1072 A Nice XOR Pair
ユーザー kotatsugamekotatsugame
提出日時 2020-06-05 21:36:16
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 293 ms / 2,000 ms
コード長 204 bytes
コンパイル時間 733 ms
コンパイル使用メモリ 77,600 KB
実行使用メモリ 18,944 KB
最終ジャッジ日時 2024-05-09 20:18:38
合計ジャッジ時間 2,430 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 3 ms
5,376 KB
testcase_07 AC 233 ms
12,800 KB
testcase_08 AC 83 ms
5,376 KB
testcase_09 AC 83 ms
5,376 KB
testcase_10 AC 101 ms
5,376 KB
testcase_11 AC 178 ms
9,216 KB
testcase_12 AC 293 ms
18,944 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    6 | main()
      | ^~~~

ソースコード

diff #

#include<iostream>
#include<map>
using namespace std;
int N,X;
map<int,int>mp;
main()
{
	cin>>N>>X;
	long ans=0;
	for(int i=0;i<N;i++)
	{
		int A;cin>>A;
		ans+=mp[X^A];
		mp[A]++;
	}
	cout<<ans<<endl;
}
0