Skip to content

Commit 46a8a5d

Browse files
committed
Enumerate quotients
1 parent ec9505b commit 46a8a5d

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

cp-algo/number_theory/dirichlet.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#include <algorithm>
44
#include <cstdint>
55
#include <ranges>
6+
#include <vector>
67
#include <cmath>
78
namespace cp_algo::math {
89
auto floor_stats(int64_t n) {
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// @brief Enumerate Quotients
2+
#define PROBLEM "https://judge.yosupo.jp/problem/enumerate_quotients"
3+
#pragma GCC optimize("Ofast,unroll-loops")
4+
#include <iostream>
5+
#include "blazingio/blazingio.min.hpp"
6+
#include "cp-algo/number_theory/dirichlet.hpp"
7+
#include <bits/stdc++.h>
8+
9+
using namespace std;
10+
using namespace cp_algo::math;
11+
12+
void solve() {
13+
int64_t n;
14+
cin >> n;
15+
auto res = floors(n) | views::drop(1);
16+
cout << size(res) << "\n";
17+
for(auto it: res) {
18+
cout << it << " ";
19+
}
20+
cout << "\n";
21+
}
22+
23+
signed main() {
24+
//freopen("input.txt", "r", stdin);
25+
ios::sync_with_stdio(0);
26+
cin.tie(0);
27+
int t = 1;
28+
//cin >> t;
29+
while(t--) {
30+
solve();
31+
}
32+
}

0 commit comments

Comments
 (0)