結果

問題 No.3002 多項式の割り算 〜easy〜
ユーザー Endered
提出日時 2025-02-04 16:47:53
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 309 bytes
コンパイル時間 4,457 ms
コンパイル使用メモリ 192,124 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2025-02-04 16:47:59
合計ジャッジ時間 5,808 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>

using namespace std;
using ll = long long;

int main(){
	ll a;
	ll b;
	cin >> a >> b;
	vector<int> xs(3,0);
	xs[2] = a;
	for(int i=0;i<b;++i){
		xs[0] = xs[1];
		xs[1] = xs[2];
		xs[2] = 0;
		xs[2] -= xs[0];
		xs[1] -= xs[0];
		xs[0] = 0;
	}
	cout << xs[1] << " " << xs[2] << endl;
}
0