結果
| 問題 |
No.40 多項式の割り算
|
| コンテスト | |
| ユーザー |
rullonz
|
| 提出日時 | 2017-10-27 19:16:47 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,558 bytes |
| コンパイル時間 | 1,598 ms |
| コンパイル使用メモリ | 165,824 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-21 21:21:51 |
| 合計ジャッジ時間 | 2,616 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 31 WA * 1 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
struct edge {int /*from**/to,cost;};
typedef long long ll;
typedef pair<int,int> P;
typedef vector<int> VI;
typedef vector<long long int> VL;
typedef vector<edge> VE;
//static const int INF = 2147483647;
//static const long long INf = 9223372000000000000;
//static const long long INF = 9223372000000000000/2;
static const int INF = 1000010000;
static const int NIL = -1;
static const int MOD = 1000000007;
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define np next_permutation
#define pq priority_queue
#define itn int
#define scnaf scanf
#define reutnr return
#define scamf scanf
//int dx4[4] = {0,1,0,-1}, dy4[4] = {-1,0,1,0};
//int dx5[5] = {-1,0,0,0,1}, dy5[5] = {0,-1,0,1,0};
//int dx8[8] = {-1,0,1,1,1,0,-1,-1}, dy8[8] = {1,1,1,0,-1,-1,-1,0};
//int dx9[9] = {-1,0,1,1,1,0,-1,-1,0}, dy9[9] = {1,1,1,0,-1,-1,-1,0,0};
//#define int ll
int a[11451];
int D;
signed main(){
scanf("%d",&D);
int rull = 0,onz = 0;
for(int i=0;i<=D;i++){
scanf("%d",&a[i]);
if(i%2==0) rull+=a[i],onz+=a[i];
else rull+=a[i],onz-=a[i];
}
int rullonz[3];
rullonz[0] = a[0];
rull -= a[0],onz -= a[0];
rullonz[2] = (rull+onz)/2;
rullonz[1] = rull-rullonz[2];
int digit=2;
if(rullonz[2]==0) digit--;
if(rullonz[1]==0) digit--;
printf("%d\n",digit);
for(int i=0;i<=digit;i++){
printf("%d",rullonz[i]);
if(i!=digit) printf(" ");
}
printf("\n");
return 0;
}
rullonz