QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#702586#9248. An Easy Math Problem53Dawns#TL 0ms3640kbC++231.4kb2024-11-02 16:14:432024-11-02 16:14:46

Judging History

This is the latest submission verdict.

  • [2024-11-02 16:14:46]
  • Judged
  • Verdict: TL
  • Time: 0ms
  • Memory: 3640kb
  • [2024-11-02 16:14:43]
  • Submitted

answer

//Author: Puremg
// #pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
// #pragma GCC optimize("O3,unroll-loops")
// #pragma GCC optimize(3,"Ofast")
#include <bits/stdc++.h>
#define deg(a) cout<<#a<<'='<<a<<"\n"
// #define int long long
#define all(a) a.begin(), a.end()
#define db double
using namespace std;
typedef pair<int,int> PII;
typedef long long ll;
const int mod = 1e9 + 7;
const int N = 5e3;
const db eps = 1e-10;
const db pi = acos(-1);
// mt19937_64 rng(random_device{}());
  
void solve() {
  int n;cin>>n;
  int ans=1;
  for(int i=2;i*i<=n;++i){
    if(n%i==0){
      int cnt=0;
      while(n%i==0){
        cnt++;
        n/=i;
      }
      ans*=(2*cnt+1);
    }
  }

  if(n>1){
    ans*=3;
  }

  cout<<(ans+1)/2<<'\n';

}
  
signed main()
{
 // auto start_time = std::chrono::high_resolution_clock::now();
 // freopen("in.txt", "r", stdin);
 // freopen("out.txt", "w", stdout);
  cin.tie(nullptr)->sync_with_stdio(false);
  cout << fixed << setprecision(15);
  int T = 1;
  cin >> T;
  while (T--) solve();
  // auto end_time = std::chrono::high_resolution_clock::now();
  // auto duration = std::chrono::duration_cast<std::chrono::milliseconds>(end_time - start_time);
  // std::cout << "程序运行时间:" << duration.count() << "毫秒" << std::endl;
  return 0;
}

/*
6
011010
000101
010111
100001
010100
100010
*/

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3640kb

input:

10
1
2
3
4
5
6
7
8
9
10

output:

1
2
2
3
2
5
2
4
3
5

result:

ok 10 lines

Test #2:

score: -100
Time Limit Exceeded

input:

2000
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
646969323...

output:


result: