QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#726635#7797. Based ZerosLn#RE 1ms3832kbC++141.0kb2024-11-09 04:32:462024-11-09 04:32:47

Judging History

你现在查看的是最新测评结果

  • [2024-11-09 04:32:47]
  • 评测
  • 测评结果:RE
  • 用时:1ms
  • 内存:3832kb
  • [2024-11-09 04:32:46]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;

int main(){
    
    
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    
    short t; cin >> t;
    
    while(t--){
        
        int n; cin >> n;
        
        vector<vector<int>> res(n);
        
        int maxzeros = INT_MIN;
        
        for(int i = 2;i < sqrt(n); i++){
            int temp = n, cnt = 0;
            while(temp >= i){
                if(temp % i == 0)
                    cnt++;
                temp /= i;
            }
            if(cnt == maxzeros){
                res[maxzeros].push_back(i);
            }else if(cnt > maxzeros && cnt){
                res[cnt].push_back(i);
                maxzeros = cnt;
            }
            
        }
        
        if(maxzeros == 1)res[maxzeros].push_back(n);
        
        cout << maxzeros << " " << res[maxzeros].size() << '\n';
        
        for(int i : res[maxzeros])cout << i << ' ';
        cout << '\n';
        
    }
    
    
    
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3832kb

input:

3
11
1007
239

output:

1 3
2 3 11 
2 2
3 10 
1 4
2 6 15 239 

result:

ok 15 numbers

Test #2:

score: -100
Runtime Error

input:

1
2

output:


result: