Submission #1114996
Source Code Expand
/** * code generated by JHelper * More info: https://github.com/AlexeyDmitriev/JHelper * @author Yulian */ #include <iostream> #include <iostream> #include <fstream> #include <vector> #include <set> #include <cmath> #include <queue> #include <deque> #include <string> #include <algorithm> #include <map> #include <iostream> #include <fstream> #include <vector> #include <set> #include <cmath> #include <queue> #include <deque> #include <string> #include <algorithm> #include <map> int getTheAnswer() { return 42; } template< class InputIt> void incAll(const InputIt &first, const InputIt &last){ for(auto it = first; it != last; ++it){ ++*it; } } template <class InputIt> void printAll(const InputIt &first, const InputIt &last, std::ostream& out){ for(InputIt it = first; it != last; ++it){ out << *it << " "; } } // only for positive integers int gcd(int a, int b){ int tmp; if(a < b){ tmp = a; a = b; b = tmp; } while(b != 0){ tmp = a; a = b; b = tmp % b; } return a; } int lcm(int a, int b){ return abs(a*b) / gcd(a, b); } using namespace std; class TaskB { public: void solve(std::istream& in, std::ostream& out) { ios::sync_with_stdio(false); long long int n, res; in >> n; res = 1; while(n > 1){ res = (res * n--) % 1000000007; } out << res << endl; } }; int main() { TaskB solver; std::istream& in(std::cin); std::ostream& out(std::cout); solver.solve(in, out); return 0; }
Submission Info
Submission Time | |
---|---|
Task | B - Training Camp |
User | Yulian |
Language | C++14 (GCC 5.4.1) |
Score | 200 |
Code Size | 1580 Byte |
Status | AC |
Exec Time | 2 ms |
Memory | 256 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 200 / 200 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | 00_example_01.txt, 00_example_02.txt, 00_example_03.txt |
All | 00_example_01.txt, 00_example_02.txt, 00_example_03.txt, 01.txt, 02.txt, 03.txt, 04.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
00_example_01.txt | AC | 1 ms | 256 KB |
00_example_02.txt | AC | 1 ms | 256 KB |
00_example_03.txt | AC | 2 ms | 256 KB |
01.txt | AC | 1 ms | 256 KB |
02.txt | AC | 1 ms | 256 KB |
03.txt | AC | 2 ms | 256 KB |
04.txt | AC | 2 ms | 256 KB |