Submission #1180527


Source Code Expand

#include <cstdio>
#include <cstring>
#include <ctime>
#include <cstdlib>
#include <cmath>
#include <iostream>
#include <string>
#include <queue>
#include <map>
#include <stack>
#include <vector>
#include <algorithm>
#include <set>
#include <deque>
#include <utility>
#include <chrono>
#include <sstream>
#include <iomanip>
#define INF 1 << 30
#define MOD 1000000007;
#define pi 3.14159265358979
#define rep(i, n) for (int (i) = 0; (i) < (int)(n); (i)++)
#define reu(i, l, r) for (int (i) = (int)(l); (i) < (int)(r); (i)++)
#define D(x) cout << x << endl
#define d(x) cout << x
#define all(x) (x).begin(), (x).end()
#define pub(x) push_back(x)
#define pob() pop_back()
#define puf(x) push_front(x)
#define pof() pop_front()
#define mp(x, y) make_pair((x), (y))
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<long long> vll;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef pair<long, long> pll;
template<typename T, typename U> inline void amin(T &x, U y) { if (y < x) x = y; }
template<typename T, typename U> inline void amax(T &x, U y) { if (x < y) x = y; }
static const int dx[] = {0, 0, 1, -1};
static const int dy[] = {-1, 1, 0, 0};

int main() { 
  int a, b;
  cin >> a >> b;
  if (b < a) {
    swap(a, b);
  }
  int ans = 0;
  while (b - a >= 10) {
    a += 10;
    ans++;
  }
  if (b - a == 9) {
    ans += 2;
  }
  if (b - a == 8) {
    ans += 3;
  }
  if (b - a == 7) {
    ans += 3;
  }
  if (b - a == 6) {
    ans += 2;
  }
  if (b - a == 5) {
    ans += 1;
  }
  if (b - a == 4) {
    ans += 2;
  }
  if (b - a == 3) {
    ans += 3;
  }
  if (b - a == 2) {
    ans += 2;
  }
  if (b - a == 1) {
    ans += 1;
  }
  D(ans);
  return 0;
}

Submission Info

Submission Time
Task B - リモコン
User KokiYmgch
Language C++14 (GCC 5.4.1)
Score 100
Code Size 1813 Byte
Status AC
Exec Time 1 ms
Memory 256 KB

Judge Result

Set Name All
Score / Max Score 100 / 100
Status
AC × 35
Set Name Test Cases
All 00_maxdiff.txt, 00_maxret.txt, 00_sample1.txt, 00_sample2.txt, 00_sample3.txt, 01_rnd_00.txt, 01_rnd_01.txt, 01_rnd_02.txt, 01_rnd_03.txt, 01_rnd_04.txt, 01_rnd_05.txt, 01_rnd_06.txt, 01_rnd_07.txt, 01_rnd_08.txt, 01_rnd_09.txt, 01_rnd_10.txt, 01_rnd_11.txt, 01_rnd_12.txt, 01_rnd_13.txt, 01_rnd_14.txt, 01_rnd_15.txt, 01_rnd_16.txt, 01_rnd_17.txt, 01_rnd_18.txt, 01_rnd_19.txt, 01_rnd_20.txt, 01_rnd_21.txt, 01_rnd_22.txt, 01_rnd_23.txt, 01_rnd_24.txt, 01_rnd_25.txt, 01_rnd_26.txt, 01_rnd_27.txt, 01_rnd_28.txt, 01_rnd_29.txt
Case Name Status Exec Time Memory
00_maxdiff.txt AC 1 ms 256 KB
00_maxret.txt AC 1 ms 256 KB
00_sample1.txt AC 1 ms 256 KB
00_sample2.txt AC 1 ms 256 KB
00_sample3.txt AC 1 ms 256 KB
01_rnd_00.txt AC 1 ms 256 KB
01_rnd_01.txt AC 1 ms 256 KB
01_rnd_02.txt AC 1 ms 256 KB
01_rnd_03.txt AC 1 ms 256 KB
01_rnd_04.txt AC 1 ms 256 KB
01_rnd_05.txt AC 1 ms 256 KB
01_rnd_06.txt AC 1 ms 256 KB
01_rnd_07.txt AC 1 ms 256 KB
01_rnd_08.txt AC 1 ms 256 KB
01_rnd_09.txt AC 1 ms 256 KB
01_rnd_10.txt AC 1 ms 256 KB
01_rnd_11.txt AC 1 ms 256 KB
01_rnd_12.txt AC 1 ms 256 KB
01_rnd_13.txt AC 1 ms 256 KB
01_rnd_14.txt AC 1 ms 256 KB
01_rnd_15.txt AC 1 ms 256 KB
01_rnd_16.txt AC 1 ms 256 KB
01_rnd_17.txt AC 1 ms 256 KB
01_rnd_18.txt AC 1 ms 256 KB
01_rnd_19.txt AC 1 ms 256 KB
01_rnd_20.txt AC 1 ms 256 KB
01_rnd_21.txt AC 1 ms 256 KB
01_rnd_22.txt AC 1 ms 256 KB
01_rnd_23.txt AC 1 ms 256 KB
01_rnd_24.txt AC 1 ms 256 KB
01_rnd_25.txt AC 1 ms 256 KB
01_rnd_26.txt AC 1 ms 256 KB
01_rnd_27.txt AC 1 ms 256 KB
01_rnd_28.txt AC 1 ms 256 KB
01_rnd_29.txt AC 1 ms 256 KB