結果
| 問題 | No.40 多項式の割り算 |
| コンテスト | |
| ユーザー |
testestest
|
| 提出日時 | 2015-08-10 11:49:00 |
| 言語 | C90 (gcc 12.4.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 259 bytes |
| 記録 | |
| コンパイル時間 | 193 ms |
| コンパイル使用メモリ | 29,864 KB |
| 最終ジャッジ日時 | 2026-02-23 19:14:56 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 31 WA * 1 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:3:1: warning: incompatible implicit declaration of built-in function ‘scanf’ [-Wbuiltin-declaration-mismatch]
3 | scanf("%d",&n);
| ^~~~~
main.c:1:1: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’
+++ |+#include <stdio.h>
1 | int main(){
main.c:6:9: warning: incompatible implicit declaration of built-in function ‘printf’ [-Wbuiltin-declaration-mismatch]
6 | if(a[2])printf("2\n%d %d %d",*a,a[1],a[2]);
| ^~~~~~
main.c:6:9: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’
main.c:8:29: warning: format ‘%d’ expects a matching ‘int’ argument [-Wformat=]
8 | else if(a[0])printf("0\n%d %d",*a);
| ~^
| |
| int
ソースコード
int main(){
int n,a[100001]={},i;
scanf("%d",&n);
for(i=0;~scanf("%d",a+i);i++);
for(;n>2;n--)a[n-2]+=a[n];
if(a[2])printf("2\n%d %d %d",*a,a[1],a[2]);
else if(a[1])printf("1\n%d %d",*a,a[1]);
else if(a[0])printf("0\n%d %d",*a);
else puts("0\n0");
return 0;
}
testestest