Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
の INPUT セクションを参照して、
http://www.codechef.com/problems/FCTRL
t の値にはどのデータ型を使用すればよいですか? また、int と unsigned int の処理オーバーヘッドは同じですか?
C では、0 から 100,000 までの整数の最適な推奨事項は次のようになります。
最高が速度を意味する場合:uint_fast32_t
uint_fast32_t
最適な場合はスペース: uint_least32_t.
uint_least32_t
int一部のマシンでは 2 バイトです。移植性が重要な場合は、それを考慮してください。
int
一般に、と では処理に大きな違いはありませsignedんunsigned。一部のコンパイラ/最適化/マシンでは、特定のコマンド (右シフト、除算など) が大幅に異なる可能性があり、プロファイリングが最適な判断方法です。
signed
unsigned