結果
| 問題 | 
                            No.434 占い
                             | 
                    
| コンテスト | |
| ユーザー | 
                             hanorver
                         | 
                    
| 提出日時 | 2016-10-15 00:15:23 | 
| 言語 | C++14  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                TLE
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 459 bytes | 
| コンパイル時間 | 561 ms | 
| コンパイル使用メモリ | 64,384 KB | 
| 実行使用メモリ | 10,624 KB | 
| 最終ジャッジ日時 | 2024-11-22 08:35:50 | 
| 合計ジャッジ時間 | 24,704 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge3 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 4 | 
| other | AC * 20 TLE * 7 | 
ソースコード
#include <iostream>
#include <string>
void solve(){
	std::string s;
	
	std::cin >> s;
	
	while(s.length() != 1){
		std::string s2;
		for(int i = 0; i < s.length() - 1; ++i){
			int t = (s[i] - '0') + (s[i + 1] - '0');
			if(t / 10 != 0){
				t = t % 10 + t / 10;
			}
			s2 += t + '0';
		}
		s = s2;
	}
	std::cout << s << std::endl;
}
int main() {
	int test_case;
	
	std::cin >> test_case;
	
	for(int i = 0; i < test_case; ++i){
		solve();
	}
	
	return 0;
}
            
            
            
        
            
hanorver