QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#726642#7797. Based ZerosLn#WA 1ms3628kbC++141.1kb2024-11-09 04:42:392024-11-09 04:42:39

Judging History

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

  • [2024-11-09 04:42:39]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3628kb
  • [2024-11-09 04:42:39]
  • 提交

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);
        if(maxzeros < 1){
            cout << "1 1\n" << n << '\n';
        }
        else{
            cout << maxzeros << " " << res[maxzeros].size() << '\n';
            
            for(int i : res[maxzeros])cout << i << ' ';
            cout << '\n';
        }
        
    }
    
    
    
    return 0;
}

详细

Test #1:

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

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: 0
Accepted
time: 0ms
memory: 3512kb

input:

1
2

output:

1 1
2

result:

ok 3 number(s): "1 1 2"

Test #3:

score: -100
Wrong Answer
time: 0ms
memory: 3608kb

input:

10
56
20
6
84
25
20
60
73
70
50

output:

3 1
2 
3 1
2 
1 2
2 6 
4 1
2 
2 2
2 5 
3 1
2 
2 2
2 3 
4 1
2 
4 1
2 
3 1
2 

result:

wrong answer 8th numbers differ - expected: '3', found: '2'