fork download
  1. #include <iostream>
  2. #include <algorithm>
  3. #include <string>
  4. #include <vector>
  5. #include <cmath>
  6. #include <queue>
  7. #include <functional>
  8. using namespace std;
  9. long long power[20];
  10. class TCPhoneHome {
  11. public:
  12. long long validNumbers(int n, vector<string>S) {
  13. power[0] = 1; for (int i = 1; i < 19; i++)power[i] = power[i - 1] * 10LL;
  14. long long ret = power[n];
  15. for (int i = 0; i < S.size(); i++) {
  16. bool OK = false;
  17. for (int j = 0; j < S.size(); j++) {
  18. if (i == j)continue;
  19. if (S[i].size() < S[j].size())continue;
  20. if (S[i].substr(0, S[j].size()) == S[j])OK = true;
  21. }
  22. if (OK == false)ret -= power[n - S[i].size()];
  23. }
  24. return ret;
  25. }
  26. };
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
/usr/lib/gcc/x86_64-linux-gnu/6/../../../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