結果
問題 |
No.849 yuki国の分割統治
|
ユーザー |
![]() |
提出日時 | 2019-03-16 00:05:45 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 388 bytes |
コンパイル時間 | 1,457 ms |
コンパイル使用メモリ | 166,952 KB |
実行使用メモリ | 13,632 KB |
最終ジャッジ日時 | 2024-10-06 20:43:53 |
合計ジャッジ時間 | 7,505 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 4 |
other | WA * 9 TLE * 1 -- * 16 |
ソースコード
#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; }