結果

問題 No.666 1000000007で割るだけ
コンテスト
ユーザー ciel
提出日時 2017-09-24 01:29:48
言語 C(gnu17)
(gcc 15.2.0)
コンパイル:
gcc-15 -O2 -std=gnu17 -Wno-error=implicit-function-declaration -Wno-error=implicit-int -Wno-error=incompatible-pointer-types -Wno-error=int-conversion -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 286 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 151 ms
コンパイル使用メモリ 38,976 KB
最終ジャッジ日時 2026-02-22 00:16:32
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 24
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

//テスターやるならこういった芸もありかなと(型に注目).
#include <stdio.h>
int mul(int x,int y,int m){
	int z=0;
	while(y){
		if(y&1)z=(z+x)%m;
		x=(x+x)%m;
		y>>=1;
	}
	return z;
}
int main(){
	int a,b;
	scanf("%d%d",&a,&b);
	printf("%d\n",mul(a,b,1000000007));
}
0