1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | #include <stdio.h> long long N, n[100001], x, index[100001]; int main(void) { long long i, j, cnt = 0, v, a, b; scanf("%lld %lld", &N, &x); for (i = 1; i <= N; i++){ scanf("%lld", &n[i]); } for (i = 0; i <= 100000; i++){ index[i] = 0; } for (i = 1; i <= N; i++){ cnt += index[x^n[i]]; index[n[i]]++; } printf("%lld", cnt); return 0; } | cs |
http://codeforces.com/problemset/problem/742/B
내가 영알못이라 문제를 잘못 이해한건가
화면에 나온 케이스는 통과되는데 이상하네
댓글 0