結果
問題 | No.2781 A%B問題 |
ユーザー |
👑 |
提出日時 | 2023-04-09 22:48:59 |
言語 | C++17(gcc12) (gcc 12.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 985 bytes |
コンパイル時間 | 828 ms |
コンパイル使用メモリ | 73,032 KB |
最終ジャッジ日時 | 2025-02-12 04:27:34 |
ジャッジサーバーID (参考情報) |
judge2 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 20 |
ソースコード
#pragma GCC optimize ( "O3" ) #pragma GCC optimize( "unroll-loops" ) #pragma GCC target ( "sse4.2,fma,avx2,popcnt,lzcnt,bmi2" ) #include <iostream> #include <stdio.h> #include <stdint.h> #include <cassert> using namespace std; #define MAIN main #define TYPE_OF( VAR ) remove_const<remove_reference<decltype( VAR )>::type >::type #define UNTIE ios_base::sync_with_stdio( false ); cin.tie( nullptr ) #define CEXPR( LL , BOUND , VALUE ) constexpr const LL BOUND = VALUE #define CIN( LL , A ) LL A; cin >> A #define ASSERT( A , MIN , MAX ) assert( ( MIN ) <= A && A <= ( MAX ) ) #define CIN_ASSERT( A , MIN , MAX ) CIN( TYPE_OF( MAX ) , A ); ASSERT( A , MIN , MAX ) #define QUIT return 0 #define COUT( ANSWER ) cout << ( ANSWER ) << "\n" #define RETURN( ANSWER ) COUT( ANSWER ); QUIT int MAIN() { UNTIE; CEXPR( int , bound , 100 ); CIN_ASSERT( A , -bound , bound ); CIN_ASSERT( B , -bound , bound ); assert( B != 0 ); RETURN( ( A %= B ) < 0 ? B < 0 ? A -=B : A += B : A ); }