洛谷笔记 - P5739 【深基 7. 例 7】计算阶乘

当初提交的时候不幸遇到了
洛谷日爆

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Judger internal error

Traceback (most recent call last):
File "/app/luogu-judger/source/executor/LrunExecutor.py", line 43, in execute
cwd=work_dir, stdout=subprocess.DEVNULL)
File "/usr/lib/python3.7/subprocess.py", line 323, in call
with Popen(*popenargs, **kwargs) as p:
File "/usr/lib/python3.7/subprocess.py", line 775, in __init__
restore_signals, start_new_session)
File "/usr/lib/python3.7/subprocess.py", line 1453, in _execute_child
restore_signals, start_new_session, preexec_fn)
BlockingIOError: [Errno 11] Resource temporarily unavailable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/app/luogu-judger/source/tasks/Judge.py", line 153, in judge
execution_limits=limits)
File "/app/luogu-judger/source/judger/Judger.py", line 40, in judge
execution_limits=execution_limits)
File "/app/luogu-judger/source/judger/ProgramRunner.py", line 72, in execute
mirror_directories=work_dir)
File "/app/luogu-judger/source/executor/LrunExecutor.py", line 78, in execute
shell=True, stdin=None, stdout=None, stderr=None)
File "/usr/lib/python3.7/subprocess.py", line 323, in call
with Popen(*popenargs, **kwargs) as p:
File "/usr/lib/python3.7/subprocess.py", line 775, in __init__
restore_signals, start_new_session)
File "/usr/lib/python3.7/subprocess.py", line 1453, in _execute_child
restore_signals, start_new_session, preexec_fn)
BlockingIOError: [Errno 11] Resource temporarily unavailable
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
//洛谷OJ P5739 【深基7.例7】计算阶乘
//不用for/while算阶乘
/*---------------------
提交三次评测机炸两次
---------------------*/
#include<iostream>
using namespace std;
int n;
int ans=1;
int times(int i){
if(i==n){
return ans;
}else{
ans*=i+1;
return times(i+1);
}
}
int main(){
cin>>n;
int o=times(1);
cout<<o<<endl;
return 0;
}