Created
July 9, 2015 15:25
-
-
Save kusano/ff4e110a6178ae77cf57 to your computer and use it in GitHub Desktop.
ホリエモンからの挑戦状
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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