library

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

View the Project on GitHub firiexp/library

:heavy_check_mark: util/ifloor.cpp

Verified with

Code

template<class T>T ifloor(T x, T y){
    return x/y-(x%y ? (x < 0)^(y < 0) : 0);
}

template<class T>inline T iceil(T x, T y){
    return x/y+(x%y ? (x >= 0)^(y < 0) : 0);
}
#line 1 "util/ifloor.cpp"
template<class T>T ifloor(T x, T y){
    return x/y-(x%y ? (x < 0)^(y < 0) : 0);
}

template<class T>inline T iceil(T x, T y){
    return x/y+(x%y ? (x >= 0)^(y < 0) : 0);
}
Back to top page