結果

問題 No.373 かけ算と割った余り
コンテスト
ユーザー rapurasu
提出日時 2016-08-08 16:06:36
言語 C++11
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=gnu++11 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 477 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,458 ms
コンパイル使用メモリ 176,048 KB
実行使用メモリ 6,400 KB
最終ジャッジ日時 2026-05-07 15:59:19
合計ジャッジ時間 1,862 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 5
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

 #include<bits/stdc++.h>
 using namespace std;
#define INF 1000000000
#define REP(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
int main(){
    long long A,B,C,D;
    cin>>A>>B>>C>>D;
    long long res1=A%D;
    long long res2=B%D;
    long long res3=C%D;
    long long res4=res1*res2;
    long long res5=res4%D;
    long long res6=res5*res3;
    long long res7=res6%D;
/*
    long long ans=A/D;
    ans+=B/D;
    ans+=C/D;
    ans+=res4/D;
    ans+=res6/D;
*/
    cout<<res7<<endl;
}
0