結果
問題 | No.2016 Countdown Divisors |
ユーザー |
![]() |
提出日時 | 2022-07-22 21:35:16 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 377 ms / 2,000 ms |
コード長 | 544 bytes |
コンパイル時間 | 1,893 ms |
コンパイル使用メモリ | 191,540 KB |
最終ジャッジ日時 | 2025-01-30 12:07:12 |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 19 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define ll long long int main() { ios::sync_with_stdio(0); cin.tie(0); int T; cin >> T; for (int i=0;i<T;i++) { ll N; cin >> N; if (N >= 100) { cout << 2 << "\n"; } else { while (N >= 3) { int cnt = 0; for (int j=1;j<=N;j++) { if (N%j == 0) cnt++; } N -= cnt; } cout << N << "\n"; } } return 0; }