0分求解
查看原帖
0分求解
1549214
liuheqinghans0106楼主2025/1/5 10:00
#include<bits/stdc++.h>
using namespace std;

int main(){
    int n;
    cin>>n;
    int a[n];
    for(int i=0;i<n;i++){
        cin>>a[i];
    }
    int t=0;
    int s;
    for(int i=0;i<n;i++){
        s=2;
        for(int j=0;j<n;j++){
            if(a[i]+a[j]==1){
                t++;
                continue;
            }
            if((a[i]+a[j])%s==s){
                t++;
                s++;
                continue;
            }
            s++;
        }
    }
    cout<<t;
    return 0;
}
2025/1/5 10:00
加载中...