Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int kol=0; // ЭТО СУПЕР ПЕРЕМЕННАЯ КОЛ(ОГЕРМАНСКАЯ)
- int main(){
- const int m=80,
- b =50;
- int N,temp,arr[2][m];
- for(int i=0; i<2; ++i){
- for(int j=0; j<m; ++j){
- arr[i][j]=0;
- }
- }
- cin >>N;
- for(int i=0; i<N; ++i){
- cin >> temp;
- if(temp < b)
- arr[0][temp%m]++;
- else
- arr[1][temp%m]++;
- }
- for(int i=0; i<m/2; ++i){
- kol += arr[0][i] * arr[1][m-i] ;
- kol += arr[1][i] * arr[1][m-i];
- }
- kol += arr[1][0]*(arr[1][0]-1)/2;
- kol += arr[1][m/2]*(arr[1][m/2]-1)/2;
- cout << kol;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement