結果

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

ソースコード

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 + B;
  }
  else{
    ans = A % B;
  }

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