105 lines
16 KiB
HTML
105 lines
16 KiB
HTML
<!doctype html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; style-src 'unsafe-inline'; script-src 'unsafe-inline'; base-uri 'none'; form-action 'none'">
|
|
<title>Contest Help (offline) · ACPC 2026</title>
|
|
<style>
|
|
:root{color-scheme:light;--ink:#1c3043;--muted:#4a6275;--line:#d4e0e6;--accent:#14615c}
|
|
*{box-sizing:border-box}body{margin:0;background:#f3f6f8;color:var(--ink);font:17px/1.6 system-ui,sans-serif}
|
|
header{background:#153746;color:#fff;padding:36px max(24px,calc((100vw - 1180px)/2))}
|
|
header p{max-width:800px;color:#d4e8ed;margin:8px 0}h1{font-size:clamp(28px,4vw,42px);line-height:1.2;margin:8px 0 16px}
|
|
.eyebrow{font-size:14px;letter-spacing:.08em;text-transform:uppercase}a{color:#115f70;text-underline-offset:3px}a:focus-visible,button:focus-visible,input:focus-visible{outline:3px solid #c08619;outline-offset:3px}
|
|
.layout{max-width:1228px;margin:0 auto;display:grid;grid-template-columns:250px minmax(0,1fr);gap:32px;padding:32px 24px}
|
|
aside{align-self:start;position:sticky;top:24px}label{font-weight:650;display:block;margin-bottom:6px}input{font:inherit;padding:10px 12px;border:1px solid #8096a4;border-radius:6px;width:100%}button{font:inherit;padding:5px 12px;cursor:pointer;background:#fff;border:1px solid #8096a4;border-radius:5px;margin-top:8px}
|
|
nav{margin-top:24px}nav a{display:block;padding:5px 0;text-decoration:none}nav a:hover{text-decoration:underline}.count{color:var(--muted);font-size:14px;margin:8px 0}
|
|
article{background:#fff;padding:24px 28px;border:1px solid var(--line);border-radius:8px;margin:0 0 20px;scroll-margin-top:20px}article[hidden]{display:none}h2{font-size:24px;line-height:1.3;margin:0 0 14px}h3{font-size:18px;margin:18px 0 6px}p{margin:10px 0}li{margin:6px 0}ul,ol{padding-left:22px}code,pre{font-family:ui-monospace,monospace;font-size:.91em}code{background:#eef3f5;padding:1px 4px;border-radius:3px}pre{overflow-x:auto;background:#eef3f5;padding:16px;border-radius:5px;line-height:1.5}pre code{padding:0}
|
|
table{border-collapse:collapse;width:100%;font-size:16px}th,td{text-align:left;vertical-align:top;padding:10px 8px;border-bottom:1px solid var(--line)}th:first-child,td:first-child{width:160px}.sources{font-size:14px;color:var(--muted);border-top:1px solid var(--line);padding-top:12px;margin-top:20px}.sources a{margin-right:10px}footer{max-width:1180px;margin:0 auto;padding:0 24px 32px;color:var(--muted);font-size:14px}.empty{padding:30px;background:#fff;border:1px solid var(--line)}
|
|
@media(max-width:760px){.layout{display:block;padding:20px 16px}aside{position:static;margin-bottom:24px}nav{display:flex;flex-wrap:wrap;gap:4px 18px}article{padding:20px}header{padding:24px}th:first-child,td:first-child{width:120px}}
|
|
@media print{body{background:#fff;font-size:11pt}header{background:#fff;color:#000;padding:0}header p{color:#000}.layout{display:block;padding:0}aside,button{display:none}article,article[hidden]{display:block;border:0;padding:0;break-inside:avoid}a{color:inherit}.sources{font-size:9pt}footer{padding:0}}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<header><div class="eyebrow">ACPC 2026 · Local reference</div><h1>Contest Help (offline)</h1><p>Input, judging and language questions for C, C++, Java and Python 3. All articles on this page work without Internet access.</p></header>
|
|
<div class="layout">
|
|
<aside aria-label="Find an article">
|
|
<label for="search">Search help</label><input id="search" type="search" placeholder="Try EOF, Java or memory" autocomplete="off"><button id="clear" type="button">Clear search</button><p id="count" class="count" role="status" aria-live="polite">12 articles</p>
|
|
<nav aria-label="Articles">
|
|
<a href="#input-output">Input and output</a><a href="#eof">Reading until EOF</a><a href="#valid-input">Valid input</a><a href="#local-tests">Testing locally</a><a href="#judging">How judging works</a><a href="#judgements">Judgements</a><a href="#rejected">Investigating a rejection</a><a href="#c-cpp">C and C++</a><a href="#java-main">Java main class</a><a href="#java-io">Java input and formatting</a><a href="#java-errors">Java exceptions</a><a href="#python">Python 3 and modules</a>
|
|
</nav>
|
|
<p class="count"><a href="../../icpc/TechNotes.pdf">Technical Notes</a><br><a href="https://devdocs/">Language Documentation</a></p>
|
|
</aside>
|
|
<main id="articles">
|
|
<p id="empty" class="empty" hidden>No matching article. Try a shorter search or clear the search.</p>
|
|
<article id="input-output"><h2>Input and output</h2>
|
|
<p>Read the problem's input from standard input and write the answer to standard output. Follow the format in the statement. Do not print prompts, progress messages or debugging text as part of the answer.</p>
|
|
<p>For local tests, save the input in a file and redirect it into your program. Redirection supplies the file contents through standard input, just as typing would. You do not need to open a named input file in the program.</p>
|
|
<p class="sources">Source (online): <a href="https://support.kattis.com/support/solutions/articles/79000120852-how-do-i-handle-input-and-output-">Kattis input and output</a></p></article>
|
|
<article id="eof"><h2>Reading until EOF</h2>
|
|
<p>Some problems provide a test count or a terminating value. Others end when no input remains. Follow the rule in the statement.</p>
|
|
<p>End of file, or EOF, is a condition reported by a read operation. It is not a word to enter in the input. A redirected input file ends automatically. In a terminal, finish your input line with Enter, then press Ctrl+D on an empty line to signal EOF.</p>
|
|
<p class="sources">Source (online): <a href="https://support.kattis.com/support/solutions/articles/79000120853-how-do-i-read-input-if-the-end-is-not-defined-what-is-end-of-file-">Kattis end of file</a></p></article>
|
|
<article id="valid-input"><h2>Valid input</h2>
|
|
<p>The judge's input follows the problem's input specification. Your solution can rely on the stated ranges and structure. Include the boundary values that the statement allows when constructing local tests.</p>
|
|
<p class="sources">Source (online): <a href="https://support.kattis.com/support/solutions/articles/79000121166-how-do-i-handle-input-that-does-not-follow-the-input-specification-">Kattis input specification</a></p></article>
|
|
<article id="local-tests"><h2>Testing locally</h2>
|
|
<p>Use the sample input and expected output from the problem page, then test additional cases. Passing the samples does not prove the solution is correct for every permitted input.</p>
|
|
<p>For a C++ file named <code>main.cpp</code> and a sample saved as <code>sample.in</code>, the contest machine provides these commands:</p>
|
|
<pre><code>compilecpp main.cpp
|
|
runcpp < sample.in > actual.out
|
|
diff -u sample.ans actual.out</code></pre>
|
|
<p>Save the expected output in <code>sample.ans</code>. Read the <a href="../../icpc/TechNotes.pdf">Technical Notes</a> for the equivalent commands in the other languages and for IDE build actions. Local runs do not enforce the judge's time and memory limits. A text comparison can help locate differences, but the problem's output rules determine whether an answer is valid.</p>
|
|
<p class="sources">Source (online): <a href="https://support.kattis.com/support/solutions/articles/79000122495-can-i-test-my-solution-before-i-submit-">Kattis local testing</a>. Commands are specific to the ACPC image.</p></article>
|
|
<article id="judging"><h2>How judging works</h2>
|
|
<p>Kattis first compiles the submission or checks it as required by the chosen language. It then runs the program on test inputs and checks the answers against the problem's rules. Each test run starts a new process, so program variables do not carry over between test files.</p>
|
|
<p>The judge enforces resource limits and may stop checking after a failure. A rejection therefore does not describe every possible problem with the submission. Some problems allow several valid answers or a specified numerical tolerance. Read their output requirements carefully.</p>
|
|
<p class="sources">Source (online): <a href="https://support.kattis.com/support/solutions/articles/79000141262-how-judging-works">Kattis judging process</a></p></article>
|
|
<article id="judgements"><h2>Judgements</h2>
|
|
<table><thead><tr><th scope="col">Result</th><th scope="col">Meaning</th></tr></thead><tbody>
|
|
<tr><th scope="row">Accepted</th><td>The submission passed the required checks.</td></tr>
|
|
<tr><th scope="row">Compile Error</th><td>The build or language check failed. Read the compiler output.</td></tr>
|
|
<tr><th scope="row">Run Time Error</th><td>The program crashed, raised an uncaught exception or ended with a nonzero exit code.</td></tr>
|
|
<tr><th scope="row">Time Limit Exceeded</th><td>A run exceeded the time allowed for a test.</td></tr>
|
|
<tr><th scope="row">Wrong Answer</th><td>An answer did not satisfy the output requirements.</td></tr>
|
|
<tr><th scope="row">Output Limit Exceeded</th><td>The program produced too much output, possibly because of a loop or debugging prints.</td></tr>
|
|
<tr><th scope="row">Memory Limit Exceeded</th><td>The run needed more memory than allowed. Memory exhaustion can also appear as a run time error.</td></tr>
|
|
<tr><th scope="row">Judge Error</th><td>The judging system encountered a problem. Ask contest staff.</td></tr>
|
|
</tbody></table>
|
|
<p class="sources">Source (online): <a href="https://support.kattis.com/support/solutions/articles/79000141261-list-of-possible-judgements">Kattis judgement list</a></p></article>
|
|
<article id="rejected"><h2>Investigating a rejection</h2>
|
|
<p>Read the judgement and any compiler or run feedback available on the submission page. Check the selected language and submitted files, then reproduce the issue locally where possible.</p>
|
|
<p>Recheck input parsing, output formatting and the limits in the statement. Test small cases that you can solve by hand, boundary values and cases with different input structures. Remove debugging output before submitting again. Hidden test inputs are generally unavailable, so the samples alone are not a complete test suite.</p>
|
|
<p class="sources">Sources (online): <a href="https://support.kattis.com/support/solutions/articles/79000030851-my-submissions-are-getting-rejected-what-can-i-do-">Rejected submissions</a><a href="https://support.kattis.com/support/solutions/articles/79000138570-why-don-t-you-provide-the-secret-test-data-">Hidden test data</a></p></article>
|
|
<article id="c-cpp"><h2>C and C++</h2>
|
|
<p>Use an <code>int main(...)</code> entry point and finish successful execution with a zero exit status. A nonzero exit status is a run time error even if the printed answer looks correct.</p>
|
|
<p>For C++ programs with substantial input or output, stream synchronization and repeated flushing can be expensive. Before any stream I/O, <code>std::ios::sync_with_stdio(false);</code> and <code>std::cin.tie(nullptr);</code> can reduce that overhead. After disabling synchronization, keep input and output within the C++ stream API. Prefer <code>'\n'</code> to <code>std::endl</code> when a flush is unnecessary.</p>
|
|
<p class="sources">Sources (online): <a href="https://support.kattis.com/support/solutions/articles/79000122476-what-happens-if-main-does-not-return-0-">C exit status</a><a href="https://support.kattis.com/support/solutions/articles/79000122478-what-happens-if-main-does-not-return-0-">C++ exit status</a><a href="https://support.kattis.com/support/solutions/articles/79000122479-i-m-having-trouble-with-i-o-performance-with-cin-and-cout-in-c-what-can-i-do-about-it-">C++ I/O performance</a></p></article>
|
|
<article id="java-main"><h2>Java main class</h2>
|
|
<p>The main class is the class containing <code>public static void main(String[] args)</code>. Enter its class name, without <code>.java</code> or <code>.class</code>, when Kattis asks for it. If the class belongs to a package, the main class name includes that package.</p>
|
|
<p>For the local single-file workflow in the Technical Notes, use a file such as <code>Main.java</code>, a class named <code>Main</code> and no package declaration. Compile with <code>compilejava Main.java</code> and run with <code>runjava Main</code>.</p>
|
|
<p class="sources">Source (online): <a href="https://support.kattis.com/support/solutions/articles/79000122481-what-is-the-mainclass-for-java-why-do-i-get-unknown-mainclass-">Kattis Java main class</a>. Local commands are specific to the ACPC image.</p></article>
|
|
<article id="java-io"><h2>Java input and formatting</h2>
|
|
<p><code>Scanner</code> is convenient but may be too slow for large inputs. Buffered reading and writing can reduce I/O overhead. Read the input specification before choosing how to split lines or tokens.</p>
|
|
<p>Locale affects formatted numbers. Kattis documents the <code>en_US</code> locale for Java, which uses a decimal point. For predictable local formatting, specify <code>java.util.Locale.US</code> where the formatting API accepts a locale, and follow the problem's requested precision.</p>
|
|
<p class="sources">Sources (online): <a href="https://support.kattis.com/support/solutions/articles/79000122482-i-m-having-trouble-with-i-o-performance-what-can-i-do-about-it-">Java I/O performance</a><a href="https://support.kattis.com/support/solutions/articles/79000122483-what-locale-is-used-useful-for-e-g-printf-in-java-">Java locale</a></p></article>
|
|
<article id="java-errors"><h2>Java exceptions</h2>
|
|
<p>An uncaught exception normally causes a run time error. Memory exhaustion can be reported as a memory limit error. The feedback available from Kattis may be shorter than the stack trace you see locally.</p>
|
|
<p>When reproducing a failure, inspect the local exception and the line where it arose. Check bounds, parsing, null references and memory use against the problem's valid inputs.</p>
|
|
<p class="sources">Source (online): <a href="https://support.kattis.com/support/solutions/articles/79000122480-what-happens-with-java-exceptions-">Kattis Java exceptions</a></p></article>
|
|
<article id="python"><h2>Python 3 and modules</h2>
|
|
<p>The ACPC Python 3 runtime is PyPy 7.3.23, implementing Python 3.11.15. Use the configured PyPy interpreter or the <code>compilepython3</code> and <code>runpython3</code> commands for local tests. CPython and PyPy can differ in performance and some implementation details.</p>
|
|
<p>Use the Python standard library available in the contest runtime. Do not assume that a third-party module installed elsewhere will be available on the judge. An import of an unavailable module fails at run time. The local Python 3.11 documentation is available in <a href="https://devdocs/">Language Documentation</a>.</p>
|
|
<p class="sources">Sources (online): <a href="https://support.kattis.com/support/solutions/articles/79000122490-what-implementation-of-python-are-you-using-">Python implementation</a><a href="https://support.kattis.com/support/solutions/articles/79000122491-what-python-modules-are-available-">Python modules</a>. Version numbers are from the ACPC configuration.</p></article>
|
|
</main></div>
|
|
<footer>Prepared for ACPC 2026 from the linked Kattis support articles, checked on 15 October 2026. These are concise summaries with local instructions. The contest rules and problem statements take precedence. Source links require Internet access outside the contest restrictions.</footer>
|
|
<script>
|
|
const search=document.getElementById('search');
|
|
const articles=[...document.querySelectorAll('article')];
|
|
function filter(){const words=search.value.toLowerCase().trim().split(/\s+/).filter(Boolean);let count=0;for(const a of articles){a.hidden=!words.every(w=>a.textContent.toLowerCase().includes(w));if(!a.hidden)count++}document.getElementById('count').textContent=count+' of '+articles.length+' articles';document.getElementById('empty').hidden=count!==0}
|
|
search.addEventListener('input',filter);
|
|
document.getElementById('clear').addEventListener('click',()=>{search.value='';filter();search.focus()});
|
|
document.querySelectorAll('nav a').forEach(a=>a.addEventListener('click',()=>{search.value='';filter()}));
|
|
</script>
|
|
</body></html>
|