結果

問題 No.432 占い(Easy)
ユーザー ldsyb
提出日時 2016-10-14 22:52:19
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 11 ms / 2,000 ms
コード長 349 bytes
コンパイル時間 532 ms
コンパイル使用メモリ 67,036 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-11-22 08:16:50
合計ジャッジ時間 1,437 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;

int main(){
	int t;
	cin >> t;
	while(t--){
		string s;
		cin >> s;
		while(s.size() != 1){
			string tmp = "";
			for(int i = 0; i + 1 < s.size(); i++){
				int n = (s[i] - '0') + (s[i + 1] - '0');
				if(n >= 10) n = n / 10 + n % 10;
				tmp += to_string(n);
			}
			s = tmp;
		}
		cout << s << endl;
	}
}
0