結果

問題 No.1595 The Final Digit
コンテスト
ユーザー sin
提出日時 2023-07-20 14:24:58
言語 C(gnu17)
(gcc 15.2.0)
コンパイル:
gcc-15 -O2 -std=gnu17 -Wno-error=implicit-function-declaration -Wno-error=implicit-int -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
TLE  
実行時間 -
コード長 319 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 171 ms
コンパイル使用メモリ 38,240 KB
最終ジャッジ日時 2026-02-22 11:02:03
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample -- * 3
other AC * 4 TLE * 1 -- * 12
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include<stdio.h>
int main(){
    int p,q,r;
    long long int K;
    int i;
    scanf("%d%*c%d%*c%d%*c%lld",&p,&q,&r,&K);    
    int A[4]={p,q,r,(p+q+r)%10};
    for(i=0;i<K-4;i++){
        A[0]=A[1];
        A[1]=A[2];
        A[2]=A[3];
        A[3]=(A[0]+A[1]+A[2])%10;
    }
    printf("%d",A[3]);
    return 0;
}
0