fork download
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. const int MOD=100000007;
  4. int main()
  5. {
  6. string s;
  7. cin>>s;
  8. long long fac=0;
  9. for(auto c:s)
  10. {
  11. fac=((fac*10)+(c-'0'))%MOD;
  12. }
  13. long long res=1;
  14. for(long long i=1; i<=MOD; i++)
  15. {
  16. res=res*i;
  17. res=res%MOD;
  18. if(res==fac)
  19. {
  20. cout<<i<<endl;
  21. break;
  22. }
  23. }
  24.  
  25. }
  26.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:1: error: illegal character: '#'
#include<bits/stdc++.h>
^
Main.java:1: error: class, interface, or enum expected
#include<bits/stdc++.h>
        ^
Main.java:3: error: class, interface, or enum expected
const int MOD=100000007;
^
Main.java:4: error: class, interface, or enum expected
int main()
^
Main.java:7: error: class, interface, or enum expected
    cin>>s;
    ^
Main.java:8: error: class, interface, or enum expected
    long long fac=0;
    ^
Main.java:9: error: class, interface, or enum expected
    for(auto c:s)
    ^
Main.java:12: error: class, interface, or enum expected
    }
    ^
Main.java:14: error: class, interface, or enum expected
    for(long long i=1; i<=MOD; i++)
    ^
Main.java:14: error: class, interface, or enum expected
    for(long long i=1; i<=MOD; i++)
                       ^
Main.java:14: error: class, interface, or enum expected
    for(long long i=1; i<=MOD; i++)
                               ^
Main.java:17: error: class, interface, or enum expected
        res=res%MOD;
        ^
Main.java:18: error: class, interface, or enum expected
        if(res==fac)
        ^
Main.java:21: error: class, interface, or enum expected
            break;
            ^
Main.java:22: error: class, interface, or enum expected
        }
        ^
15 errors
stdout
Standard output is empty