結果

問題 No.2818 A Game I Play to Pass the Time
ユーザー highlighter
提出日時 2024-06-27 09:37:53
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
TLE  
実行時間 -
コード長 564 bytes
コンパイル時間 5,123 ms
コンパイル使用メモリ 309,204 KB
実行使用メモリ 14,080 KB
最終ジャッジ日時 2024-06-29 13:37:21
合計ジャッジ時間 12,409 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample TLE * 1
other -- * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
#include<atcoder/all>
using namespace std;
using namespace atcoder;
using mint=modint998244353;

long long divisor(long long N){
	vector<pair<long long,long long>> vec;
	for(int i=2;N>1;i++){
		if(N%i==0){
			int mem=0;
			while(N%i==0){
				N/=i;
				mem++;
			}
			vec.emplace_back(i,mem);
		}
	}
	long long ans=1;
	for(auto i : vec){
		ans*=i.second+1;
	}
	return ans;
}

int main(){
	int M,Q;
	scanf("%d%d",&M,&Q);
	long long ans=0;
	for(;Q--;){
		long long N,S;
		scanf("%lld%lld",&N,&S);
		ans+=divisor(N);
	}
	printf("%lld\n",ans);
}
0