結果

問題 No.434 占い
ユーザー butter_rollbutter_roll
提出日時 2016-10-15 03:12:22
言語 C++11
(gcc 11.4.0)
結果
TLE  
実行時間 -
コード長 522 bytes
コンパイル時間 723 ms
コンパイル使用メモリ 66,976 KB
実行使用メモリ 13,984 KB
最終ジャッジ日時 2024-05-02 01:21:15
合計ジャッジ時間 4,169 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 4 ms
12,800 KB
testcase_01 AC 4 ms
7,424 KB
testcase_02 AC 3 ms
7,168 KB
testcase_03 AC 5 ms
7,296 KB
testcase_04 AC 3 ms
7,296 KB
testcase_05 AC 5 ms
7,424 KB
testcase_06 AC 5 ms
7,424 KB
testcase_07 AC 3 ms
7,296 KB
testcase_08 AC 41 ms
7,296 KB
testcase_09 AC 8 ms
7,296 KB
testcase_10 AC 4 ms
7,424 KB
testcase_11 AC 5 ms
7,424 KB
testcase_12 AC 17 ms
7,168 KB
testcase_13 AC 41 ms
7,424 KB
testcase_14 AC 7 ms
7,296 KB
testcase_15 TLE -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cstdio>
#include <algorithm>
#include <iostream>
#include <vector>
#include <iomanip>
#include <typeinfo>
#include <string>
using namespace std;


int main(void){

  int T,i,j,k;
  string S;
  int s[1010100];
  int t;
  cin>>T;
  char c;
  getchar();

  while(T>=1){
    k=0;
    while((c=getchar())!='\n'){
      s[k]=c-'0';
      k++;
    }
    for(i=0;i<k-1;i++){
      for(j=0;j<k-1-i;j++){
        s[j]=s[j]+s[j+1];
        if(s[j]>9) s[j]-=9;
      }
    }
    cout<<s[0]<<endl;
    T--;
  }

  return 0;
}
0