2 solutions

  • 0
    @ 2022-1-20 22:55:01
    #include<iostream>
    using namespace std;
    int main(){
        int n,ans=0;
        cin>>n;
        for(ll i=1;i<n;i++){
            if((i*i)%n<n/2)ans++;
        }
        cout<<ans;
        return 0;
    }
    

    Information

    ID
    188
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    2
    Tags
    # Submissions
    184
    Accepted
    118
    Uploaded By