PLAG0 - Editorial

PROBLEM LINK:

PRACTICE
Editorialist: Sankalp

DIFFICULTY:

EASY

PREREQUISITES:

Number Theory, Array

PROBLEM:

Chef and Chefina are BFFs. They give every CodeChef contest together and submit the same codes for the problem which is against the Code of Conduct of CodeChef. Codechef runs a MOSS checker to determine the similarity of two codes. Chef and Chefina are participating in CodeChef long challenge. There are N questions in the challenge, after checking the codes for all questions of the contest moss checker returns N number of integers where every integer represents the similarity between the codes of both participants. If the maximum similarity of any code is greater than or equal to 80 then ADMIN ban’s both the user and returns BANNED, if their maximum similarity is greater or equal to 60 and below 80 then returns PLAGIARISED -275, if the maximum similarity is less than 60 then returns COINCIDENCE. As an ADMIN your task is to print the outcome according to the above scenario.

EXPLANATION:

Here we just need to find the max element and put the conditions accordingly.

SOLUTION:

#include<bits/stdc++.h>
using namespace std;

int main(){
    int t;
    cin>>t;
    while(t--){
        int n;
        cin>>n;
        int arr[n];
        int max=0;
        
        for(int i=0; i<n; i++){
            cin>>arr[i];
        }
        sort(arr,arr+n);
        max=arr[n-1];
        if(max>=80){
            cout<<"BANNED"<<endl;
        }
        if(max>=60 && max<80){
            cout<<"PLAGIARISED -275"<<endl;
        }
        if(max<60){
            cout<<"COINCIDENCE"<<endl;
        }
    }
    return 0;
}