codechef ALEXNUMB - "magic pairs" solution: http://ideone.com/K6W4bu
#include <iostream>
#include <cstdio>
using namespace std;
int main() {
long long int t, n, a;
scanf("%lld", &t);
while(t--) {
scanf("%lld", &n);
for(int i=0; i<n; i++) scanf("%lld", &a);
printf("%lld\n", n*(n-1)/2);
}
return 0;
}
No comments:
Post a Comment