Codeforces Round #589 DIV2 A問題 - Distinct Digits

Source

Codeforces Round #589 DIV2 A問題 (500pt)
Problem description

問題概要

省略

解法

省略

cLayversion 20191006-1)のコード

C++に変換後のコードはこちら

//no-unlocked
{
  int L, R;
  int k, cnt[10];
  rd(L,R);
  rep(i,L,R+1){
    k = i;
    rep(j,10) cnt[j] = 0;
    while(k) cnt[k%10]++, k/=10;
    rep(j,10) if(cnt[j]>1) break;
    if(j==10) wt(i), return 0;
  }
  wt(-1);
}

Current time: 2024年04月28日04時34分56秒
Last modified: 2019年10月06日04時49分41秒 (by laycrs)
Tags: Competitive_Programming_Incomplete Codeforces CF589 CF_Div2_A
トップページに戻る

Logged in as: unknown user (not login)

ログイン: