Codeforces Round #462 (Div. 2) B - A Prosperous Lot

xiaoxiao2021-02-28  23

构造

#include<iostream> #include<algorithm> #include<iomanip> #include<cstdio> #include<cstdlib> #include<cstring> #include<string> #include<cmath> #include<set> #include<queue> #include<stack> #include<map> #define PI acos(-1.0) #define in freopen("in.txt", "r", stdin) #define out freopen("out.txt", "w", stdout) #define kuaidian ios::sync_with_stdio(0); using namespace std; typedef long long ll; typedef unsigned long long ull; const int maxn = 100 + 7, maxd = 1e5 + 7; const int mod = 1e9 + 7; const int INF = 0x7f7f7f7f; int k; int main() { cin >> k; if(k > 36) cout << -1; //else if(k == 0) cout << 1; else { string ans; while(k) { if(k >= 2) ans += '8', k -= 2; else ans += '4', k -= 1; } cout << ans; } return 0; }
转载请注明原文地址: https://www.6miu.com/read-2628629.html

最新回复(0)