Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // кол-во пар разница которых кратна 60. хоть одно число больше сотни
- #include <iostream>
- using namespace std;
- int main(){
- const int m=60,
- b =100;
- int N,temp,arr[2][81];
- for(int i=0; i<2; ++i){
- for(int j=0; j<81; ++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]++;
- }
- int diff=0;
- for(int i=0; i<m; ++i){
- diff += arr[0][i] * arr[1][i] + arr[1][i]*(arr[1][i]-1)/2;
- }
- cout << diff;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement