結果
| 問題 | No.432 占い(Easy) |
| コンテスト | |
| ユーザー |
chacoder1
|
| 提出日時 | 2021-05-03 20:08:30 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 539 bytes |
| 記録 | |
| コンパイル時間 | 1,755 ms |
| コンパイル使用メモリ | 211,652 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-06-20 04:00:58 |
| 合計ジャッジ時間 | 2,580 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 22 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<n;i++)
#define int long long
signed main(void) {
int t;
cin>>t;
string s;
rep(tn,t){
cin>>s;
int n=s.length();
int a[n];
int nx=n;
rep(i,n) a[i]=s[i]-'0';
while(nx>1){
rep(j,nx-1){
if(a[j]+a[j+1]<=9){
a[j]=a[j]+a[j+1];
}
else{
a[j]=a[j]+a[j+1]-9;
}
}
nx--;
//cout<<nx<<"#"<<a[0]<<endl;
}
cout<<a[0]<<endl;
}
}
chacoder1