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

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

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
//洛谷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;
}
Just Programming With ♥️ & Peace
使用 Hugo 构建
主题 StackJimmy 设计