結果
問題 |
No.40 多項式の割り算
|
ユーザー |
![]() |
提出日時 | 2018-12-28 03:05:43 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 572 bytes |
コンパイル時間 | 475 ms |
コンパイル使用メモリ | 58,044 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-10-01 14:57:45 |
合計ジャッジ時間 | 1,451 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 20 WA * 12 |
ソースコード
#include <iostream> #include <algorithm> #include <cstdio> #include <string> #define ll long long using namespace std; int main(){ int d; cin>>d; int tmp; int f=0,s=0,c=0; for(int i=0;i<=d;++i){ if(!i) cin>>c; else{ cin>>tmp; if(i%2) s+=tmp; else f+=tmp; } } int dem=2; if((d%2)&&f==0) dem=1; if(!(d%2)&&s==0) dem=1; if(s==0&&f==0) dem=0; cout<<dem<<endl; cout<<c; if(dem>=1) cout<<" "<<(d%2 ? s : f); if(dem==2) cout<<" "<<(d%2 ? f : s); cout<<endl; return 0; }