library

This documentation is automatically generated by online-judge-tools/verification-helper

View the Project on GitHub kisepichu/library

:heavy_check_mark: Divisors
(lib/util/divisors.hpp)

Verified with

Code

#pragma once
set<lint>divisors(lint n){
	set<lint>ret;
	for(lint i=1; i*i<=n; ++i){
		if(n%i==0){
			ret.insert(i);
			if(i*i!=n)ret.insert(n/i);
		}
	}
	return ret;
}

/*
* @title Divisors
*/
#line 2 "lib/util/divisors.hpp"
set<lint>divisors(lint n){
	set<lint>ret;
	for(lint i=1; i*i<=n; ++i){
		if(n%i==0){
			ret.insert(i);
			if(i*i!=n)ret.insert(n/i);
		}
	}
	return ret;
}

/*
* @title Divisors
*/
Back to top page