結果
| 問題 |
No.289 数字を全て足そう
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-03-20 02:02:53 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 442 bytes |
| コンパイル時間 | 1,442 ms |
| コンパイル使用メモリ | 158,600 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-09-14 20:12:50 |
| 合計ジャッジ時間 | 2,096 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define REP(i,N) for(i=0;i<N;i++)
typedef long long ll;
typedef pair<int, int> P;
typedef struct{
int first;
int second;
int third;
}T;
//昇順
bool comp_Se(T& l, T& r){
return l.second < r.second;
}
int main(void){
string S;
string num="123456789";
cin >> S;
int i,j,sum=0;
REP(i,S.size())REP(j,num.size()) if(num[j] == S[i]) sum += j+1;
cout << sum << endl;
return 0;
}