提出 #33258832


ソースコード 拡げる

#include <bits/stdc++.h>
using namespace std;
template<typename A> inline void rd(A &a) {
  cin >> a;
}
template<typename A, typename ...B> inline void rd(A &a, B &...b) {
  cin >> a;
  rd(b...);
}
template<typename A> inline void O(const A &a) {
  cout << a << '\n';
}
template<typename A, typename ...B> inline void O(const A &a, const B &...b) {
  cout << a << ' ';
  O(b...);
}
template<typename T> inline void ckmin(T &x, const T &a) {
  x = min(x, a);
}
template<typename T> inline void ckmax(T &x, const T &a) {
  x = max(x, a);
}
#ifdef MISAKA
#define err(...) fprintf(stderr, __VA_ARGS__)
#else
#define err(...)
#endif
#define FOR(i,j,k) for (int i = (j); i <= (k); ++i)
#define ROF(i,j,k) for (int i = (k); i >= (j); --i)
typedef unsigned u32;
typedef long long i64;
typedef unsigned long long u64;
typedef pair<int ,int> pii;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
// #define IOFILE "filename"
// #define MULTI
const int N = 0;

inline void sol() {
  int n;
  rd(n);
  O(n<<1);
  int r = n % 4;
  if (r) cout << r;
  FOR(i,1,n/4) cout << 4;
  cout << '\n';
}

int main() {
#ifndef MISAKA
  cin.tie(0);
  ios::sync_with_stdio(false);
#ifdef IOFILE
  freopen(IOFILE ".in", "r", stdin);
  freopen(IOFILE ".out", "w", stdout);
#endif
#endif
#ifdef MULTI
  int T;
  rd(T);
  while (T--)
#endif
  sol();
  return 0;
}

提出情報

提出日時
問題 A - Digit Sum of 2x
ユーザ misaka18931
言語 C++ (GCC 9.2.1)
得点 300
コード長 1423 Byte
結果 AC
実行時間 5 ms
メモリ 3636 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 300 / 300
結果
AC × 3
AC × 28
セット名 テストケース
Sample 01_sample_01.txt, 01_sample_02.txt, 01_sample_03.txt
All 01_sample_01.txt, 01_sample_02.txt, 01_sample_03.txt, 02_small_01.txt, 02_small_02.txt, 02_small_03.txt, 02_small_04.txt, 02_small_05.txt, 02_small_06.txt, 02_small_07.txt, 02_small_08.txt, 02_small_09.txt, 02_small_10.txt, 02_small_11.txt, 02_small_12.txt, 02_small_13.txt, 02_small_14.txt, 02_small_15.txt, 03_rand_01.txt, 03_rand_02.txt, 03_rand_03.txt, 03_rand_04.txt, 03_rand_05.txt, 04_max_01.txt, 04_max_02.txt, 04_max_03.txt, 04_max_04.txt, 04_max_05.txt
ケース名 結果 実行時間 メモリ
01_sample_01.txt AC 1 ms 3512 KiB
01_sample_02.txt AC 3 ms 3524 KiB
01_sample_03.txt AC 2 ms 3636 KiB
02_small_01.txt AC 2 ms 3592 KiB
02_small_02.txt AC 2 ms 3516 KiB
02_small_03.txt AC 3 ms 3596 KiB
02_small_04.txt AC 2 ms 3624 KiB
02_small_05.txt AC 2 ms 3636 KiB
02_small_06.txt AC 2 ms 3464 KiB
02_small_07.txt AC 1 ms 3596 KiB
02_small_08.txt AC 2 ms 3464 KiB
02_small_09.txt AC 2 ms 3524 KiB
02_small_10.txt AC 2 ms 3556 KiB
02_small_11.txt AC 2 ms 3568 KiB
02_small_12.txt AC 2 ms 3516 KiB
02_small_13.txt AC 2 ms 3516 KiB
02_small_14.txt AC 2 ms 3636 KiB
02_small_15.txt AC 2 ms 3504 KiB
03_rand_01.txt AC 3 ms 3588 KiB
03_rand_02.txt AC 2 ms 3532 KiB
03_rand_03.txt AC 3 ms 3568 KiB
03_rand_04.txt AC 2 ms 3556 KiB
03_rand_05.txt AC 2 ms 3600 KiB
04_max_01.txt AC 5 ms 3528 KiB
04_max_02.txt AC 3 ms 3628 KiB
04_max_03.txt AC 4 ms 3528 KiB
04_max_04.txt AC 4 ms 3468 KiB
04_max_05.txt AC 5 ms 3472 KiB