QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#702596#9248. An Easy Math Problem53Dawns#AC ✓39ms3744kbC++231.4kb2024-11-02 16:15:302024-11-02 16:15:45

Judging History

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

  • [2024-11-02 16:15:45]
  • 评测
  • 测评结果:AC
  • 用时:39ms
  • 内存:3744kb
  • [2024-11-02 16:15:30]
  • 提交

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
*/

这程序好像有点Bug,我给组数据试试?

詳細信息

Test #1:

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

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

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:

29525
29525
29525
29525
29525
29525
29525
29525
29525
29525
29525
29525
29525
29525
29525
29525
29525
29525
29525
29525
29525
29525
29525
29525
29525
29525
29525
29525
29525
29525
29525
29525
29525
29525
29525
29525
29525
29525
29525
29525
29525
29525
29525
29525
29525
29525
29525
29525
29525
29525
...

result:

ok 2000 lines

Test #3:

score: 0
Accepted
time: 39ms
memory: 3744kb

input:

2000
1763047095
79735483
1016286871
2864801397
2327774116
2668010360
3469893354
3634459021
1613699068
781737219
574741575
2763134701
1458502604
1822260248
2281150332
2924219311
2493931196
3735904708
158802001
2006921221
729928782
1974841034
727412600
2873393292
1291087179
2741607663
1893408215
29827...

output:

14
5
2
5
23
95
68
14
8
68
203
14
23
32
38
41
8
8
14
2
608
41
158
338
23
41
14
5
14
41
14
203
41
14
17
446
5
53
59
878
2
14
365
203
14
203
2
122
32
95
41
41
5
23
14
41
5
5
14
122
23
203
608
23
41
122
2
14
95
2
68
41
203
14
230
41
68
23
50
14
32
14
8
5
5
5
68
68
122
293
473
5
41
41
14
2
14
14
5
2
122
...

result:

ok 2000 lines

Extra Test:

score: 0
Extra Test Passed