{{ $t('FEZ002') }}程式設計競賽|
一、比賽用電腦已安裝軟體如下:
1. Visual Studio 2022
建議用於撰寫 C / C++ / C# 程式。
內含 Python IDLE 3.13,可用於 Python 程式設計。
2. Visual Studio Code 1.1
可用於 C / C++ / Python 開發。
⚠️請避免在路徑或檔名中使用中文,以免導致編譯錯誤。
Code::Blocks 17
可用於 C / C++ 開發。
二、C / C++ 使用者注意事項 — 編譯器與標頭檔
1. 比賽電腦採用 MSVC 編譯系統(不含 GCC 編譯器)。
若您在 Visual Studio 或 VS Code 中使用了 GCC/MinGW 專用的標頭檔,請改用 MSVC 支援的標準 C++ 標頭。
常見錯誤範例:
#include <bits/stdc++.h>
編譯時會出現:
fatal error C1083: cannot open file 'bits/stdc++.h'
請選用以下標準 C++ 標頭(可直接複製使用):
#include <iostream>
#include <vector>
#include <array>
#include <string>
#include <cstring>
#include <cctype>
#include <cmath>
#include <limits>
#include <algorithm>
#include <numeric>
#include <functional>
#include <queue>
#include <stack>
#include <deque>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <tuple>
#include <utility>
#include <iomanip>
#include <bitset>
2. 提供簡化用法:
在桌面資料夾 114kh 中,已提供備用標頭檔 MSVC.std。
若原程式中有使用:#include <bits/stdc++.h>
請改為:#include <MSVC.std>
即可在 MSVC 環境下順利編譯執行。
三、特殊軟體安裝
比賽試場電腦為Windows作業系統。如使用其他軟體者或編譯器,參賽者需自
備軟體,必須由承辦單位審查後,請於比賽前一天11月8日 下午 1 時至 4 時
親至比賽現場安裝 , 比賽當天沒有開放對外網路。
四、本範例使用求矩形面積為例,5種語言程式碼OJ格式
第一題:矩形面積計算
輸入矩形的 長 與 寬,請計算出矩形的 面積。
假設輸入的長與寬皆為正整數。
輸入為兩個整數 L、W,中間以空白分隔,
其中 1 ≤ L, W ≤ 10^4。 代表矩形的長與寬。
請輸出矩形的面積(長 × 寬),結果為整數。
10 5 範例輸出一:50範例輸入二:3 5 範例輸出二:15
==1. Python 參考程式碼 a.py ===
L, W = map(int, input().split())
print(L * W)
==2. C 參考程式碼 a.c ===
#include <stdio.h>
int main() {
int L, W;
scanf("%d %d", &L, &W);
printf("%d\n", L * W);
return 0;
}
==3. C++ 參考程式碼 a.cpp ===
#include <iostream>
using namespace std;
int main() {
int L, W;
cin >> L >> W;
cout << L * W << endl;
return 0;
}
==4. C# 參考程式碼 a.csharp ===
using System;
class Program {
static void Main() {
string[] input = Console.ReadLine().Split();
int L = int.Parse(input[0]);
int W = int.Parse(input[1]);
Console.WriteLine(L * W);
}
}
==5. Java 參考程式碼 Main.java ===
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int L = sc.nextInt();
int W = sc.nextInt();
System.out.println(L * W);
}
}
=== 狀態代碼 (Code) ====
pending 等待中:程式已送出,系統尚未開始評測。
running 執行中:評測伺服器正在執行你的程式。
compiling 編譯中:系統正在編譯你的原始碼。
correct 答對了:所有測資都通過。✅
compiler-error 編譯錯誤:程式無法成功編譯(語法錯誤、缺少 main 等)。
run-error 執行錯誤:程式在執行中發生錯誤(如除以零、記憶體錯誤)。
time-limit 時間超限:執行超過題目限制時間。
memory-limit 記憶體超限:程式使用的記憶體超過上限。
output-limit 輸出超限:輸出過多資料(超過題目規定的上限)。
wrong-answer 答案錯誤:輸出結果與標準答案不符。
no-output 無輸出:程式沒有產生任何輸出。
presentation-error 格式錯誤:輸出內容正確但格式不符合(常被視為 Wrong Answer)。
security-violation 安全性違規:使用被禁止的系統呼叫或試圖存取不允許的資源。
judging 評測中:系統正在評測,不久後會出結果。
internal-error 系統錯誤:DOMjudge 本身或評測機發生問題。
{{ $t('FEZ012') }}
{{ $t('FEZ003') }}2025-10-16
{{ $t('FEZ004') }}2025-11-06|
{{ $t('FEZ005') }}298|