/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 11ms 540.0 KiB
#2 Wrong Answer 11ms 536.0 KiB
#3 Accepted 11ms 540.0 KiB
#4 Accepted 10ms 536.0 KiB
#5 Wrong Answer 10ms 532.0 KiB

Code

/*CODED BY mahmudulsakib2019
  DATE:-02/04/2024;TIME:-07:49 AM
  BANGALDESH , SYLHET*/
///PROBLEM LINK:-https://judge.eluminatis-of-lu.com/p/1028
#include<bits/stdc++.h>
using namespace std;
typedef unsigned long long  ll;

int main(){
    int X,a,b,c,N,count=0;
    cin >> X >>a  >> b >> c >> N;
    vector<ll>p;
    for(int l=0;l<=200;l++){
        for(int z=0;z<=200;z++){
            for(int q =0;q<=200;q++){
                if((X+(l*a)+(z*b)+(q*c))==N){
                    p.push_back(l+z+q);
                }
            }
        }
    }
    if(p.size()>0){
        cout << "YES\n" << *min_element(p.begin(),p.end()) << endl;
    }
    else{
        cout << "NO" ;
    }    

    return 0;
}

Information

Submit By
Type
Submission
Problem
P1028 Magical box and spell
Language
C++20 (G++ 13.2.0)
Submit At
2024-04-02 02:52:32
Judged At
2024-11-11 03:36:29
Judged By
Score
25
Total Time
11ms
Peak Memory
540.0 KiB