結果

問題 No.432 占い(Easy)
ユーザー ebicochineal
提出日時 2016-10-21 09:32:00
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 5 ms / 2,000 ms
コード長 428 bytes
コンパイル時間 438 ms
コンパイル使用メモリ 55,516 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-23 15:59:34
合計ジャッジ時間 1,360 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
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 > 9 ? a % 10 + 49 : a + 48;
            }
        }
        cout << s[0] << endl;
    }
    return 0;
}
0