結果

問題 No.432 占い(Easy)
ユーザー 0w1
提出日時 2016-11-24 15:59:31
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 496 bytes
コンパイル時間 2,001 ms
コンパイル使用メモリ 166,996 KB
実行使用メモリ 331,036 KB
最終ジャッジ日時 2024-11-27 10:33:49
合計ジャッジ時間 59,770 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1 TLE * 1
other AC * 4 TLE * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

signed main(){
  int T; cin >> T;
  for( int i = 0; i < T; ++i ){
    string S; cin >> S;
    while( S.size() > 1 ){
      string t;
      for( int i = 0; i + 1 < S.size(); ++i ){
        int x = S[ i ] + S[ i + 1 ] - 2 * '0';
        if( x < 10 )
          t += ( char ) ( '0' + x );
        else
          t += ( char ) ( '0' + x / 10 ), t += ( char ) ( '0' + x % 10 );
      }
      swap( t, S );
    }
    cout << S << endl;
  }
  return 0;
}

 
0