Hướng dẫn giải của Bedao Grand Contest 04 - ZEZE


Chỉ dùng lời giải này khi không có ý tưởng, và đừng copy-paste code từ lời giải này. Hãy tôn trọng người ra đề và người viết lời giải.
Nộp một lời giải chính thức trước khi tự giải là một hành động có thể bị ban.

Code mẫu

Copy
#include <bits/stdc++.h>
using namespace std;
#define tag "ZEZE"
#define forinc(i,a,b) for(int i=a;i<=b;i++)
#define checkfile(FiLeNaMe) { if(fopen(FiLeNaMe".inp","r")) freopen(FiLeNaMe".inp","r",stdin),freopen(FiLeNaMe".out","w",stdout); }


void enter(){
    int m,n;
    int fi=0,tw=0;

    cin>>m;
    forinc(i,1,m){
        cin>>n;
        while(n%2==0) ++tw,n/=2;
        while(n%5==0) ++fi,n/=5;
    }

    cout<<min(tw,fi);
}

void solve(){
}

signed main(){

    checkfile(tag)
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

    enter();
    solve();

    return 0;
}

Bình luận

Hãy đọc nội quy trước khi bình luận.


Không có bình luận tại thời điểm này.