1 solutions
-
0
Guest MOD
-
2
#include<bits/stdc++.h> typedef long long ll; using namespace std; const int N=10010; int chi[N],mat[N]; int eng[N],tot[N]; int ans,n;; int main(){ cin.sync_with_stdio(false); ios::sync_with_stdio(0); cin>>n; for(int i=1;i<=n;++i){ cin>>chi[i]>>mat[i]>>eng[i]; tot[i]=chi[i]+mat[i]+eng[i]; } for(int i=1;i<=n;i++){ for(int j=i+1;j<=n;j++){ if((abs(chi[i]-chi[j])<=5)&&(abs(mat[i]-mat[j])<=5)&&(abs(eng[i]-eng[j])<=5)&&(abs(tot[i]-tot[j])<=10)){ ans++; } } } cout<<ans; return 0; }
- 1
Information
- ID
- 404
- Time
- 1000ms
- Memory
- 256MiB
- Difficulty
- 3
- Tags
- (None)
- # Submissions
- 47
- Accepted
- 28
- Uploaded By