結果

問題 No.1849 Three Times Value
ユーザー mmn15277198
提出日時 2022-03-06 01:08:59
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 178 ms / 2,000 ms
コード長 534 bytes
コンパイル時間 1,063 ms
コンパイル使用メモリ 103,160 KB
実行使用メモリ 9,856 KB
最終ジャッジ日時 2024-07-20 08:37:11
合計ジャッジ時間 4,628 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 26
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
#include <queue>
#include <map>
#include <cmath>
#include <iomanip>
#include <set>
#include <cstdio>
#include <string>

using namespace std;

int main() {
  long long n;
  cin >> n;
  map<long long, int> mp;
  for (long long i = 1; i < 1000000; i++) {
    if (i >= n) break;
    string s = to_string(i) + to_string(i) + to_string(i);
    long long now = stoll(s);
    if (now <= n) {
      mp[now]++;
    }
  }
  cout << mp.size() << endl;
  return 0;
}
0