Skip to content

Instantly share code, notes, and snippets.

@kusano
Created July 9, 2015 15:25
Show Gist options
  • Save kusano/ff4e110a6178ae77cf57 to your computer and use it in GitHub Desktop.
Save kusano/ff4e110a6178ae77cf57 to your computer and use it in GitHub Desktop.
ホリエモンからの挑戦状
#include <iostream>
#include <vector>
using namespace std;
int main()
{
int L; cin>>L;
int N; cin>>N;
vector<int> a(N);
vector<bool> b(L);
for (int &t: a)
cin>>t,
b[t] = true;
int ans = 0;
for (int x: a)
for (int y: a)
if (x<y && y<L-x-y && b[L-x-y])
ans++;
cout<<ans<<endl;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment