Submission #162555


Source Code Expand

// C Library
#include <cassert> // (assert.h) C Diagnostics Library (header)
#include <cctype> // (ctype.h) Character handling functions (header)
#include <cerrno> // (errno.h) C Errors (header)
#include <cfloat> // (float.h) Characteristics of floating-point types (header)
#include <ciso646> // (iso646.h) ISO 646 Alternative operator spellings (header)
#include <climits> // (limits.h) Sizes of integral types (header)
#include <clocale> // (locale.h) C localization library (header)
#include <cmath> // (math.h) C numerics library (header)
#include <csetjmp> // (setjmp.h) Non local jumps (header)
#include <csignal> // (signal.h) C library to handle signals (header)
#include <cstdarg> // (stdarg.h) Variable arguments handling (header)
#include <cstdbool> // (stdbool.h) Boolean type (header)
#include <cstddef> // (stddef.h) C Standard definitions (header)
#include <cstdint> // (stdint.h) Integer types (header)
#include <cstdio> // (stdio.h) C library to perform Input/Output operations (header)
#include <cstdlib> // (stdlib.h) C Standard General Utilities Library (header)
#include <cstring> // (string.h) C Strings (header)
#include <ctime> // (time.h) C Time Library (header)
//#include <cuchar> // (uchar.h) Unicode characters (header)
#include <cwchar> // (wchar.h) Wide characters (header)
#include <cwctype> // (wctype.h) Wide character type (header)

// Containers
#include <array> // Array header (header)
#include <bitset> // Bitset header (header)
#include <deque> // Deque header (header)
#include <forward_list> // Forward list (header)
#include <list> // List header (header)
#include <map> // Map header (header)
#include <queue> // Queue header (header)
#include <set> // Set header (header)
#include <stack> // Stack header (header)
#include <unordered_map> //Unordered map header (header)
#include <unordered_set> // Unordered set header (header)
#include <vector> // Vector header (header)

// Input/Output Stream Library
#include <iostream> // The class relies on a single streambuf object for both the input and output operations.
#include <fstream> // Input/output stream class to operate on files.
#include <sstream> // 

// Miscellaneous headers
#include <algorithm> // Standard Template Library: Algorithms (library )
#include <chrono> // Time library (header)
//#include <codecvt> // Unicode conversion facets (header)
#include <complex> // Complex numbers library (header)
#include <exception> // Standard exceptions (header)
#include <functional> // Function objects (header)
#include <initializer_list> // Initializer list (header)
#include <iterator> // Iterator definitions (header)
#include <limits> // Numeric limits (header)
#include <locale> // Localization library (header)
#include <memory> //Memory elements (header)
#include <new> // Dynamic memory (header)
#include <numeric> // Generalized numeric operations (header)
#include <random> // Random (header)
#include <ratio> // Ratio header (header)
#include <regex> // Regular Expressions (header)
#include <stdexcept> // Exception classes (header)
#include <string> // Strings (header)
#include <system_error> // System errors (header)
#include <tuple> // Tuple library (header)
#include <typeinfo> // Type information (header)
#include <type_traits> //type_traits (header)
#include <utility> // Utility components (header)
#include <valarray> // Library for arrays of numeric values (header)

#define FOR(k,a,b) for(int (k)=(a);(k)<(b);++(k))
#define ALL(c) (c).begin(),(c).end()

int case_number;
#define gprint case_number++, printf("Case #%d: ",case_number), printf
#define gout case_number++, printf("Case #%d: ",case_number), std::cout

typedef unsigned long long ull;
typedef unsigned long ul;
typedef unsigned int uint;
const int INF = 100000007;
const int MOD = 100000007;
const double EPS = 1e-9;

using namespace std;

template <typename T>
void input(T &tmp){cin>>tmp;}

template <typename T>
void output(T &tmp){cout<<tmp<<endl;}

template <typename T>
void inputs(T &tmp){int N=tmp.size();FOR(i,0,N)cin>>tmp[i];}

template <typename T>
void outputs(T &tmp){int N=tmp.size();FOR(i,0,N)cout<<tmp[i]<<" ";cout<<endl;}

class hoge
{
private:
public:
};


/*
bool is_9(ull n)
{
  bool f = false;
  stringstream ss;
  ss << n;
  string s;
  s = ss.str();
  ull len = s.size();
  FOR(i,0,len) if ( s[i] == '9' ) {f = true; return f;}
  return f;
}
*/

bool is_ok(ull n)
{
  bool f = false;
  stringstream ss;
  ss << n;
  string s;
  s = ss.str();
  ull len = s.size();
  FOR(i,0,len) if ( s[i] == '4' || s[i] == '9') {f = true; return f;}
  return f;
}

int main()
{
  ull A, B;
  cin >> A >> B;
  ull ans = 0;
  FOR(i,A,B+1) {
	if ( is_ok(i) ) ans++;
  }
  cout << ans << endl;
  return 0;
}

Submission Info

Submission Time
Task D - 禁止された数字
User laitaka
Language C++11 (GCC 4.8.1)
Score 30
Code Size 4841 Byte
Status WA
Exec Time 2034 ms
Memory 928 KB

Judge Result

Set Name Sample Subtask1 Subtask2
Score / Max Score 0 / 0 30 / 30 0 / 70
Status
AC × 3
TLE × 1
AC × 16
AC × 16
WA × 11
TLE × 12
Set Name Test Cases
Sample subtask0_sample01.txt, subtask0_sample02.txt, subtask0_sample03.txt, subtask0_sample04.txt
Subtask1 subtask1_01.txt, subtask1_02.txt, subtask1_03.txt, subtask1_04.txt, subtask1_05.txt, subtask1_06.txt, subtask1_07.txt, subtask1_08.txt, subtask1_09.txt, subtask1_10.txt, subtask1_11.txt, subtask1_12.txt, subtask1_13.txt, subtask0_sample01.txt, subtask0_sample02.txt, subtask0_sample03.txt
Subtask2 subtask0_sample01.txt, subtask0_sample02.txt, subtask0_sample03.txt, subtask0_sample04.txt, subtask1_01.txt, subtask1_02.txt, subtask1_03.txt, subtask1_04.txt, subtask1_05.txt, subtask1_06.txt, subtask1_07.txt, subtask1_08.txt, subtask1_09.txt, subtask1_10.txt, subtask1_11.txt, subtask1_12.txt, subtask1_13.txt, subtask2_01.txt, subtask2_02.txt, subtask2_03.txt, subtask2_04.txt, subtask2_05.txt, subtask2_06.txt, subtask2_07.txt, subtask2_08.txt, subtask2_09.txt, subtask2_10.txt, subtask2_11.txt, subtask2_12.txt, subtask2_13.txt, subtask2_14.txt, subtask2_15.txt, subtask2_16.txt, subtask2_17.txt, subtask2_18.txt, subtask2_19.txt, subtask2_20.txt, subtask2_21.txt, subtask2_22.txt
Case Name Status Exec Time Memory
subtask0_sample01.txt AC 22 ms 732 KB
subtask0_sample02.txt AC 20 ms 800 KB
subtask0_sample03.txt AC 22 ms 920 KB
subtask0_sample04.txt TLE 2030 ms 804 KB
subtask1_01.txt AC 30 ms 676 KB
subtask1_02.txt AC 22 ms 804 KB
subtask1_03.txt AC 22 ms 736 KB
subtask1_04.txt AC 22 ms 928 KB
subtask1_05.txt AC 21 ms 924 KB
subtask1_06.txt AC 22 ms 924 KB
subtask1_07.txt AC 21 ms 756 KB
subtask1_08.txt AC 25 ms 812 KB
subtask1_09.txt AC 29 ms 796 KB
subtask1_10.txt AC 24 ms 916 KB
subtask1_11.txt AC 22 ms 804 KB
subtask1_12.txt AC 23 ms 812 KB
subtask1_13.txt AC 26 ms 804 KB
subtask2_01.txt TLE 2029 ms 796 KB
subtask2_02.txt TLE 2029 ms 800 KB
subtask2_03.txt TLE 2029 ms 812 KB
subtask2_04.txt WA 20 ms 796 KB
subtask2_05.txt WA 20 ms 796 KB
subtask2_06.txt TLE 2030 ms 808 KB
subtask2_07.txt TLE 2029 ms 796 KB
subtask2_08.txt WA 21 ms 916 KB
subtask2_09.txt WA 22 ms 804 KB
subtask2_10.txt TLE 2034 ms 800 KB
subtask2_11.txt WA 21 ms 676 KB
subtask2_12.txt TLE 2030 ms 864 KB
subtask2_13.txt WA 20 ms 796 KB
subtask2_14.txt WA 21 ms 676 KB
subtask2_15.txt TLE 2029 ms 928 KB
subtask2_16.txt TLE 2033 ms 800 KB
subtask2_17.txt TLE 2029 ms 804 KB
subtask2_18.txt WA 21 ms 804 KB
subtask2_19.txt TLE 2030 ms 808 KB
subtask2_20.txt WA 20 ms 924 KB
subtask2_21.txt WA 22 ms 736 KB
subtask2_22.txt WA 21 ms 920 KB