結果

問題 No.784 「,(カンマ)」
コンテスト
ユーザー bin101
提出日時 2019-10-28 15:31:04
言語 C++11
(gcc 15.3.0 + boost 1.92.0)
コンパイル:
g++-15 -O2 -lm -std=gnu++11 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 1 ms / 2,000 ms
+ 336µs
コード長 742 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 418 ms
コンパイル使用メモリ 95,352 KB
実行使用メモリ 6,272 KB
最終ジャッジ日時 2026-08-27 11:13:37
合計ジャッジ時間 1,665 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include<cstdio>
#include<cstdlib>
#include<algorithm>
#include<iostream>
#include<queue>
#include<vector>
#include <bitset>
#include <cmath>
#include <limits>
#include <iostream>
using namespace std;
#define INF 100000
#define MAX 100000
#define MOD 1000000007
typedef long long ll;
typedef pair<int,int> P;
typedef pair< pair<int,int>, int> p; 
#define bit(n,k) ((n>>k)&1) /*nのk bit目*/
#define rad_to_deg(rad) (((rad)/2/M_PI)*360)

int main(){
    string S;
    cin>>S;
    vector<char> V;
    for(int i=S.size()-1;i>=0;i--){
        int n=S.size()-1-i;
        if(n%3==0 && n!=0){
            V.push_back(',');
        }
        V.push_back(S[i]);
    }
    for(int i=V.size()-1;i>=0;i--){
        cout<<V[i];
    }
    cout<<endl;
}

0