fork download
  1. #pragma GCC optimize ("Ofast")
  2. #include<bits/stdc++.h>
  3. using namespace std;
  4. template<class S, class T> inline S min_L(S a,T b){
  5. return a<=b?a:b;
  6. }
  7. #define main dummy_main
  8. int main(){
  9. return 0;
  10. }
  11. #undef main
  12. class Solution{
  13. public:
  14. string getSmallestString(int n, int k){
  15. int i;
  16. int j;
  17. string res;
  18. for(i=(0);i<(n);i++){
  19. res += 'a';
  20. k--;
  21. }
  22. for(i=(n)-1;i>=(0);i--){
  23. j =min_L(k, 25);
  24. res[i] += j;
  25. k -= j;
  26. }
  27. return res;
  28. }
  29. }
  30. ;
  31. // cLay version 20201121-1
  32.  
  33. // --- original code ---
  34. // #define main dummy_main
  35. // {}
  36. // #undef main
  37. //
  38. // class Solution {
  39. // public:
  40. // string getSmallestString(int n, int k) {
  41. // int i, j;
  42. // string res;
  43. // rep(i,n) res += 'a', k--;
  44. // rrep(i,n){
  45. // j = min(k, 25);
  46. // res[i] += j;
  47. // k -= j;
  48. // }
  49. // return res;
  50. // }
  51. // };
  52.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x20): undefined reference to `main'
collect2: error: ld returned 1 exit status
stdout
Standard output is empty