結果

問題 No.849 yuki国の分割統治
ユーザー tempura_pptempura_pp
提出日時 2019-03-16 00:05:45
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 388 bytes
コンパイル時間 1,696 ms
コンパイル使用メモリ 162,816 KB
実行使用メモリ 10,624 KB
最終ジャッジ日時 2024-04-16 06:53:21
合計ジャッジ時間 7,581 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 TLE -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
typedef long long ll;

ll gcd(ll x,ll y){
	if(x<y)swap(x,y);
	return y? gcd(y,x%y) : x;
}

int main(){
	ll a,b,c,d;
	cin>>a>>b>>c>>d;
	ll ret=abs(a*d-b*c);
	cout<<ret<<endl;
	ll g=gcd(a,c);
	rep(i,g)rep(j,ret/g){
		cout<<i<<" "<<j<<endl;
	}
	return 0;
}
0