Submission #1693373


Source Code Expand

#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <cstring>
#include <queue>
#include <map>
#include <set>
#include <string>
#include <cmath>
#include <iostream>

using namespace std;

#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define rep(i, n)	 for(int i = 0; i < (n); i++)
#define all(a)		 begin(a), end(a)

typedef long long int		   ll;
typedef long long unsigned int llu;

void solve(string s) {
	auto itr = begin(s);
	char a	 = *itr;
	itr = end(s);
	char b	 = *(--itr);
	printf("%c%d%c", a, s.length() - 2, b);
}

int main() {
	string s;
	cin >> s;
	solve(s);
	return 0;
}

Submission Info

Submission Time
Task B - i18n
User noni
Language C++14 (GCC 5.4.1)
Score 200
Code Size 658 Byte
Status AC
Exec Time 1 ms
Memory 256 KB

Compile Error

./Main.cpp: In function ‘void solve(std::string)’:
./Main.cpp:27:39: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘std::basic_string<char>::size_type {aka long unsigned int}’ [-Wformat=]
  printf("%c%d%c", a, s.length() - 2, b);
                                       ^

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 3
AC × 11
Set Name Test Cases
Sample 0_00.txt, 0_01.txt, 0_02.txt
All 0_00.txt, 0_01.txt, 0_02.txt, 1_00.txt, 1_01.txt, 1_02.txt, 1_03.txt, 1_04.txt, 1_05.txt, 1_06.txt, 1_07.txt
Case Name Status Exec Time Memory
0_00.txt AC 1 ms 256 KB
0_01.txt AC 1 ms 256 KB
0_02.txt AC 1 ms 256 KB
1_00.txt AC 1 ms 256 KB
1_01.txt AC 1 ms 256 KB
1_02.txt AC 1 ms 256 KB
1_03.txt AC 1 ms 256 KB
1_04.txt AC 1 ms 256 KB
1_05.txt AC 1 ms 256 KB
1_06.txt AC 1 ms 256 KB
1_07.txt AC 1 ms 256 KB