Information
- ID
- 1839
- Time
- 1000ms
- Memory
- 512MiB
- Difficulty
- 6
- Tags
- # Submissions
- 49
- Accepted
- 16
- Uploaded By
#include <bits/stdc++.h>
#define endl '\n'
using namespace std;
typedef pair<int, int> PII;
using ll = long long;
using ULL = unsigned long long;
const int N = 1e7 + 5;
ll res;
int m = 16;
string ans = "";
inline void solve() {
cin >> res;
if (res == 0) {
cout << "0" << endl;
return;
}
while (res) {
auto x = res%m;
if (x >= 10 && x <= 17) ans += 'A'+x-10;
else ans += x + '0';
res /= m;
}
reverse(ans.begin(),ans.end());
cout << ans << endl;
}
int main() {
ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
int _ = 1;
//int _; cin >> _;
while (_--) solve();
return 0;
}
By signing up a 追梦算法网 universal account, you can submit code and join discussions in all online judging services provided by us.