結果

問題 No.1168 Digit Sum Sequence
ユーザー kohkohkohkoh
提出日時 2020-08-30 13:38:54
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 5 ms / 2,000 ms
コード長 1,398 bytes
コンパイル時間 845 ms
コンパイル使用メモリ 101,404 KB
実行使用メモリ 12,076 KB
最終ジャッジ日時 2024-04-27 07:02:19
合計ジャッジ時間 1,894 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 4 ms
10,444 KB
testcase_01 AC 4 ms
11,328 KB
testcase_02 AC 5 ms
10,864 KB
testcase_03 AC 4 ms
10,688 KB
testcase_04 AC 4 ms
11,504 KB
testcase_05 AC 5 ms
10,864 KB
testcase_06 AC 5 ms
10,900 KB
testcase_07 AC 5 ms
10,536 KB
testcase_08 AC 5 ms
10,740 KB
testcase_09 AC 4 ms
10,560 KB
testcase_10 AC 4 ms
11,192 KB
testcase_11 AC 5 ms
10,288 KB
testcase_12 AC 5 ms
11,500 KB
testcase_13 AC 4 ms
11,640 KB
testcase_14 AC 4 ms
11,788 KB
testcase_15 AC 5 ms
11,732 KB
testcase_16 AC 5 ms
10,996 KB
testcase_17 AC 5 ms
10,836 KB
testcase_18 AC 5 ms
11,896 KB
testcase_19 AC 5 ms
11,420 KB
testcase_20 AC 5 ms
10,488 KB
testcase_21 AC 5 ms
11,172 KB
testcase_22 AC 5 ms
11,316 KB
testcase_23 AC 5 ms
11,292 KB
testcase_24 AC 5 ms
11,444 KB
testcase_25 AC 4 ms
11,104 KB
testcase_26 AC 4 ms
11,872 KB
testcase_27 AC 5 ms
11,696 KB
testcase_28 AC 5 ms
10,904 KB
testcase_29 AC 4 ms
10,464 KB
testcase_30 AC 4 ms
12,076 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <random>
#include <queue>
#include <stack>
#include <bitset>
#include <cassert>
#define int long long
#define double long double
#define rep(i,n) for(int i=0;i<n;i++)
#define srep(i,n,m) for(int i=n;i<m;i++)
#define elif else if
#define pi 3.141592653589793
#define prique priority_queue
constexpr auto mod=1000000007;
using namespace std;
int gcd(int a,int b){
    if(b==0) return a;
    return gcd(b,a%b);
}
int lcm(int a,int b){
    return a*b/gcd(a,b);
}
bool prime(int n){
    int cnt=0;
    for(int i=1;i<=sqrt(n);i++){
        if(n%1==0)cnt++;
    }
    if(cnt!=1) return false;
    else return n!=1;
}
struct UnionFind{
    vector<int> r;
    UnionFind(int N){
        r=vector<int>(N,-1);
    }
    int root(int x){
        if(r[x]<0) return x;
        return r[x]=root(r[x]);
    }
    bool unite(int x,int y){
        x=root(x);
        y=root(y);
        if(x==y) return false;
        if(r[x]>r[y]) swap(x,y);
        r[x]+=r[y];
        r[y]=x;
        return true;
    }
    int size(int x){
        return -r[root(x)];
    }
};
vector<int> v;
int n,m,cnt=0,ans=0,aa[220000],ab[220000];
pair<int,int> pp[220000];
string s,ss[220000];
queue<int> que;
signed main(){
    cin>>n;
    if(n%9==0){
        cout<<9;
        return 0;
    }
    cout<<n%9;
}
0