제출 #22199

#제출 시각아이디문제언어결과실행 시간메모리
22199내일 시험이에요 (#42)다항식 계산 (KRIII5P_2)C++11
2 / 7
1000 ms5060 KiB
#include <cstdio>

int a[1010101];
int main(){
    int n,p;
    scanf("%d%d",&n,&p);

    for(int i=n;i>=0;i--){
        scanf("%d",&a[i]);
        a[i]%=p;
    }
    for(int i=0;i<p;i++){
        int s = 0;
        int x = 1;
        for(int j=0;j<=n;j++){
            s=(s+x*a[j])%p;
            x=x*i%p;
        }
        printf("%d\n",s);
    }


}

컴파일 시 표준 에러 (stderr) 메시지

pc.cpp: In function 'int main()':
pc.cpp:6:24: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d%d",&n,&p);
                        ^
pc.cpp:9:26: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d",&a[i]);
                          ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...