結果

問題 No.313 π
ユーザー ytqm3ytqm3
提出日時 2021-06-21 20:59:05
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 34 ms / 5,000 ms
コード長 2,101 bytes
コンパイル時間 2,427 ms
コンパイル使用メモリ 202,436 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-05 01:55:38
合計ジャッジ時間 4,626 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
4,376 KB
testcase_01 AC 34 ms
4,376 KB
testcase_02 AC 33 ms
4,376 KB
testcase_03 AC 33 ms
4,380 KB
testcase_04 AC 33 ms
4,380 KB
testcase_05 AC 34 ms
4,380 KB
testcase_06 AC 34 ms
4,376 KB
testcase_07 AC 34 ms
4,376 KB
testcase_08 AC 34 ms
4,380 KB
testcase_09 AC 33 ms
4,380 KB
testcase_10 AC 34 ms
4,380 KB
testcase_11 AC 34 ms
4,376 KB
testcase_12 AC 33 ms
4,376 KB
testcase_13 AC 33 ms
4,376 KB
testcase_14 AC 33 ms
4,376 KB
testcase_15 AC 34 ms
4,380 KB
testcase_16 AC 34 ms
4,380 KB
testcase_17 AC 33 ms
4,376 KB
testcase_18 AC 33 ms
4,376 KB
testcase_19 AC 33 ms
4,380 KB
testcase_20 AC 34 ms
4,380 KB
testcase_21 AC 34 ms
4,380 KB
testcase_22 AC 34 ms
4,376 KB
testcase_23 AC 34 ms
4,376 KB
testcase_24 AC 34 ms
4,380 KB
testcase_25 AC 34 ms
4,380 KB
testcase_26 AC 34 ms
4,376 KB
testcase_27 AC 34 ms
4,376 KB
testcase_28 AC 33 ms
4,380 KB
testcase_29 AC 34 ms
4,376 KB
testcase_30 AC 34 ms
4,380 KB
testcase_31 AC 34 ms
4,380 KB
testcase_32 AC 34 ms
4,384 KB
testcase_33 AC 33 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
typedef uint64_t u64;
typedef int64_t i64;
typedef long double f128;
using namespace std;

template<typename T>
void scan(T& n){
  cin>>n;
}

void scan(){}

template<typename T,class... Args>
void scan(T& n,Args&... args){
  scan(n);
  scan(args...);
}

template<typename T>
void scanall(T start,T end){
  for(;start!=end;++start){
    scan(*start);
  }
}

template<typename T>
void print(T n){
  cout<<n;
}

void print(){}

template<typename T,class... Args>
void print(T n,Args... args){
  print(n);
  print(args...);
}

template<typename T>
void println(T n){
  print(n);
  cout<<endl;
}

template<typename T,class... Args>
void println(T n,Args... args){
  print(n,' ');
  println(args...);
}

template<typename T>
void printall(T start,T end){
  if(start!=end){
    print(*start);
    for(++start;start!=end;++start){
      print(' ',*start);
    }
  }
  cout<<endl;
}

template<typename T>
void chmax(T& n,T m){
  n=max(n,m);
}

template<typename T>
void chmin(T& n,T m){
  n=min(n,m);
}

template<typename T,typename U>
T power(T a,U n){
  T res=1;
  while(n){
    res*=(n&1)?a:1;
    a*=a;
    n>>=1;
  }
  return res;
}

template<typename T>
struct combination{
  vector<T> fact;
  combination(const int Max=3000000):fact(Max+1,1){
    for(int i=2;i<=Max;++i){
      fact[i]=fact[i-1]*i;
    }
  }
  template<typename U>
  T nCk(U n,U k){
    if(n<k||n<0||k<0){
      return 0;
    }
    return fact[n]/fact[k]/fact[n-k];
  }
};

void solve();

int main(){
  cout<<fixed<<setprecision(15);
  bool is_multicase=false;
  int T=1;
  if(is_multicase){
    scan(T);
  }
  for(int i=0;i<T;++i){
    solve();
  }
  return 0;
}

int strcnt(string s,string t){
  int res=0,n=s.size(),m=t.size();
  for(int i=0;i<n-m+1;++i){
    if(s.substr(i,m)==t){
      ++res;
    }
  }
  return res;
}

void solve(){
  string S;
  scan(S);
  vector<int> a={20104,20063,19892,20011,19874,20199,19898,20163,19956,19841};
  int x=-1,y=-1;
  for(int i=0;i<10;++i){
    if(strcnt(S,to_string(i))>a[i]){
      x=i;
    }
    if(strcnt(S,to_string(i))<a[i]){
      y=i;
    }
  }
  println(x,y);
}
0