結果

問題 No.40 多項式の割り算
ユーザー J31831276J31831276
提出日時 2018-12-28 03:05:43
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 572 bytes
コンパイル時間 499 ms
コンパイル使用メモリ 57,044 KB
実行使用メモリ 6,952 KB
最終ジャッジ日時 2024-04-09 03:10:18
合計ジャッジ時間 1,627 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 1 ms
6,948 KB
testcase_02 AC 1 ms
6,944 KB
testcase_03 AC 2 ms
6,944 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 3 ms
6,944 KB
testcase_07 AC 3 ms
6,948 KB
testcase_08 AC 1 ms
6,944 KB
testcase_09 AC 3 ms
6,948 KB
testcase_10 AC 3 ms
6,944 KB
testcase_11 AC 2 ms
6,944 KB
testcase_12 AC 2 ms
6,948 KB
testcase_13 WA -
testcase_14 AC 3 ms
6,952 KB
testcase_15 AC 3 ms
6,948 KB
testcase_16 AC 4 ms
6,948 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 3 ms
6,948 KB
testcase_20 AC 2 ms
6,944 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 2 ms
6,944 KB
testcase_24 WA -
testcase_25 AC 1 ms
6,948 KB
testcase_26 AC 1 ms
6,948 KB
testcase_27 AC 1 ms
6,944 KB
testcase_28 AC 2 ms
6,948 KB
testcase_29 AC 1 ms
6,944 KB
testcase_30 AC 2 ms
6,944 KB
testcase_31 WA -
testcase_32 WA -
testcase_33 AC 1 ms
6,948 KB
testcase_34 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
}
0