結果
| 問題 |
No.434 占い
|
| コンテスト | |
| ユーザー |
tossy
|
| 提出日時 | 2016-10-15 00:06:03 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 994 bytes |
| コンパイル時間 | 761 ms |
| コンパイル使用メモリ | 90,784 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-22 08:18:49 |
| 合計ジャッジ時間 | 1,914 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 WA * 1 |
| other | AC * 4 WA * 23 |
ソースコード
#include <cstdio>
#include <cstring>
#include <string>
#include <cmath>
#include <cassert>
#include <iostream>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
#include <set>
#include <map>
#include <bitset>
using namespace std;
#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repl(i,0,n)
#define mp(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<#x"="<<x<<endl
#define fi first
#define se second
#define INF 2147483600
int main(){
int tc;
scanf("%d\n", &tc);
rep(loops, tc){
vector<int> vec;
char c;
while(scanf("%c", &c)){
if(c=='\n') break;
vec.pb(c-'0');
}
int n =vec.size();
long res = 0;
long ue=n-1, shita=1;
long cc=1;
rep(i,n){
res += (long)vec[i] * cc;
cc = cc * ue / shita;
ue--; shita++;
while(res>10){
res = res/10 + res%10;
}
}
printf("%d\n", res);
}
return 0;
}
tossy