結果
| 問題 | No.849 yuki国の分割統治 |
| コンテスト | |
| ユーザー |
chocorusk
|
| 提出日時 | 2019-03-16 20:38:42 |
| 言語 | C++11(廃止可能性あり) (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 933 bytes |
| 記録 | |
| コンパイル時間 | 896 ms |
| コンパイル使用メモリ | 98,048 KB |
| 実行使用メモリ | 13,640 KB |
| 最終ジャッジ日時 | 2024-10-06 20:49:04 |
| 合計ジャッジ時間 | 7,216 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 4 |
| other | WA * 8 OLE * 2 -- * 16 |
ソースコード
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <cassert>
using namespace std;
typedef long long int ll;
typedef pair<ll, ll> P;
ll gcd(ll a, ll b){
if(b==0) return a;
return gcd(b, a%b);
}
void extgcd(ll &a, ll &b, ll &c, ll &d){
if(b==0) return;
ll q=d/b;
d-=q*b, c-=q*a;
swap(a, c); swap(b, d);
extgcd(a, b, c, d);
}
random_device rnd;
mt19937_64 mt(rnd());
uniform_int_distribution<ll> rndn(0, 1e9);
int main()
{
ll a, b, c, d;
cin>>a>>b>>c>>d;
extgcd(a, b, c, d);
if(a<0) a=-a;
int n=a*d;
cout<<n<<endl;
int ct=0;
while(ct<n){
ll x=rndn(mt), y=rndn(mt);
ct++;
cout<<x<<" "<<y<<endl;
}
return 0;
}
chocorusk