結果
問題 |
No.2016 Countdown Divisors
|
ユーザー |
![]() |
提出日時 | 2022-07-22 21:28:01 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 550 bytes |
コンパイル時間 | 4,672 ms |
コンパイル使用メモリ | 255,128 KB |
最終ジャッジ日時 | 2025-01-30 12:01:31 |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 4 TLE * 15 |
ソースコード
#include <stdio.h> #include <atcoder/all> #include <bits/stdc++.h> using namespace std; using namespace atcoder; using mint = modint998244353; #define rep(i,n) for (int i = 0; i < (n); ++i) #define Inf 1000000000 map<int,int> mp; int get(int N){ if(mp.count(N))return mp[N]; int ret = 0; for(int i=1;i*i<=N;i++){ if(N%i==0){ ret++; if(i*i!=N)ret++; } } mp[N] = ret; return ret; } int main(){ int _t; cin>>_t; rep(_,_t){ int N; cin>>N; while(N!=get(N)){ N -= get(N); } cout<<N<<endl; } return 0; }