結果

問題 No.2781 A%B問題
ユーザー YY-otter
提出日時 2024-06-17 10:42:25
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 227 bytes
コンパイル時間 844 ms
コンパイル使用メモリ 76,972 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-06-17 10:42:28
合計ジャッジ時間 2,165 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 17 WA * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>

using namespace std;
typedef long long ll;

int main() {
  ll A, B;
  cin >> A >> B;

  ll ans;

  if(A < 0){
    ans = A % B + abs(B);
  }
  else{
    ans = A % B;
  }

  cout << ans << endl;
  return 0;
}
0