結果

問題 No.432 占い(Easy)
ユーザー ebicochineal
提出日時 2016-10-21 09:57:38
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 421 bytes
コンパイル時間 458 ms
コンパイル使用メモリ 56,392 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-11-23 15:59:48
合計ジャッジ時間 1,339 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;

int main() {
    int n, a, m;
    string s;
    cin >> n;
    for (int _ = 0; _ < n; ++_) {
        cin >> s;
        m = s.size();
        for (int i = 1; i < m; ++i) {
            for (int j = 0; j < m - i; ++j) {
                a = s[j] + s[j + 1]  - 96;
                s[j] = a % 10 + a / 10 + 48;
            }
        }
        cout << s[0] << endl;
    }
    return 0;
}
0