fork download
  1. #pragma GCC optimize("Ofast")
  2. #pragma GCC optimize("unroll-loops")
  3. #pragma GCC optimize("inline")
  4. #include<bits/stdc++.h>
  5. using namespace std;
  6. #define main dummy_main
  7. int main(){
  8. return 0;
  9. }
  10. #undef main
  11. int calc(string s){
  12. int res = 0;
  13. for(auto i : s){
  14. res = 10 * res + i - 'a';
  15. }
  16. return res;
  17. }
  18. class Solution{
  19. public:
  20. bool isSumEqual(string firstWord, string secondWord, string targetWord){
  21. return calc(firstWord) + calc(secondWord) == calc(targetWord);
  22. }
  23. }
  24. ;
  25. // cLay version 20210607-1
  26.  
  27. // --- original code ---
  28. // #define main dummy_main
  29. // {}
  30. // #undef main
  31. //
  32. // int calc(string s){
  33. // int res = 0;
  34. // for(auto i : s) res = 10 * res + i - 'a';
  35. // return res;
  36. // }
  37. //
  38. // class Solution {
  39. // public:
  40. // bool isSumEqual(string firstWord, string secondWord, string targetWord) {
  41. // return calc(firstWord) + calc(secondWord) == calc(targetWord);
  42. // }
  43. // };
  44.  
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