結果

問題 No.434 占い
ユーザー butter_roll
提出日時 2016-10-15 02:42:24
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
TLE  
実行時間 -
コード長 525 bytes
コンパイル時間 612 ms
コンパイル使用メモリ 67,104 KB
実行使用メモリ 10,496 KB
最終ジャッジ日時 2024-11-22 10:37:50
合計ジャッジ時間 13,152 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 24 TLE * 3
権限があれば一括ダウンロードができます

ソースコード

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;
  string S;
  int s[100100];
  int t;
  cin>>T;
  

  
  while(T>=1){
    cin>>S;
    for(i=0;i<S.size();i++){
      s[i]=S[i]-'0';
    }
    
    for(i=0;i<S.size()-1;i++){
      for(j=0;j<S.size()-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