编号 题目 状态 分数 总时间 内存 代码 / 答案文件 提交者 提交时间
#45804 #1206. Day4D. ZJY 沉迷群星的原因 Compile Error 0 0 ms 0 K C++ 17 / 9.6 K Leohh 2020-08-07 18:56:48
显示原始代码
<span class="pl-cp">#include</span> <span class="pl-cpf">&lt;iostream&gt;</span><span class="pl-cp"></span>
<span class="pl-cp">#include</span> <span class="pl-cpf">&lt;stdio.h&gt;</span><span class="pl-cp"></span>
<span class="pl-cp">#include</span> <span class="pl-cpf">&lt;string.h&gt;</span><span class="pl-cp"></span>
<span class="pl-cp">#define MAX_N 205</span>
<span class="pl-cp">#define MAX_M 200005</span>
<span class="pl-cp">#define int long long</span>

<span class="pl-k">using</span> <span class="pl-k">namespace</span> <span class="pl-n">std</span><span class="pl-p">;</span>

<span class="pl-kt">int</span> <span class="pl-n">n</span><span class="pl-p">,</span> <span class="pl-n">m</span><span class="pl-p">;</span>
<span class="pl-kt">int</span> <span class="pl-n">v</span><span class="pl-p">[</span><span class="pl-n">MAX_N</span><span class="pl-p">];</span>
<span class="pl-kt">int</span> <span class="pl-n">w</span><span class="pl-p">[</span><span class="pl-n">MAX_N</span><span class="pl-p">];</span>
<span class="pl-kt">int</span> <span class="pl-n">c</span><span class="pl-p">[</span><span class="pl-n">MAX_N</span><span class="pl-p">];</span>
<span class="pl-kt">int</span> <span class="pl-n">f</span><span class="pl-p">[</span><span class="pl-n">MAX_M</span><span class="pl-p">];</span>

<span class="pl-kt">signed</span> <span class="pl-nf">main</span><span class="pl-p">()</span> <span class="pl-p">{</span>
    <span class="pl-n">scanf</span><span class="pl-p">(</span><span class="pl-s">&quot;%lld%lld&quot;</span><span class="pl-p">,</span> <span class="pl-o">&amp;</span><span class="pl-n">n</span><span class="pl-p">,</span> <span class="pl-o">&amp;</span><span class="pl-n">m</span><span class="pl-p">);</span>
    <span class="pl-k">for</span> <span class="pl-p">(</span><span class="pl-kt">int</span> <span class="pl-n">i</span> <span class="pl-o">=</span> <span class="pl-mi">1</span><span class="pl-p">;</span> <span class="pl-n">i</span> <span class="pl-o">&lt;=</span> <span class="pl-n">n</span><span class="pl-p">;</span> <span class="pl-n">i</span><span class="pl-o">++</span><span class="pl-p">)</span> <span class="pl-p">{</span>
        <span class="pl-n">scanf</span><span class="pl-p">(</span><span class="pl-s">&quot;%lld%lld%lld&quot;</span><span class="pl-p">,</span> <span class="pl-n">v</span> <span class="pl-o">+</span> <span class="pl-n">i</span><span class="pl-p">,</span> <span class="pl-n">w</span> <span class="pl-o">+</span> <span class="pl-n">i</span><span class="pl-p">,</span> <span class="pl-n">c</span> <span class="pl-o">+</span> <span class="pl-n">i</span><span class="pl-p">);</span>
    <span class="pl-p">}</span>
    <span class="pl-k">for</span> <span class="pl-p">(</span><span class="pl-kt">int</span> <span class="pl-n">i</span> <span class="pl-o">=</span> <span class="pl-mi">1</span><span class="pl-p">;</span> <span class="pl-n">i</span> <span class="pl-o">&lt;=</span> <span class="pl-n">n</span><span class="pl-p">;</span> <span class="pl-n">i</span><span class="pl-o">++</span><span class="pl-p">)</span> <span class="pl-p">{</span>
        <span class="pl-k">if</span> <span class="pl-p">(</span><span class="pl-n">c</span><span class="pl-p">[</span><span class="pl-n">i</span><span class="pl-p">]</span> <span class="pl-o">==</span> <span class="pl-o">-</span><span class="pl-mi">1</span><span class="pl-p">)</span> <span class="pl-p">{</span>
            <span class="pl-k">for</span> <span class="pl-p">(</span><span class="pl-kt">int</span> <span class="pl-n">j</span> <span class="pl-o">=</span> <span class="pl-n">v</span><span class="pl-p">[</span><span class="pl-n">i</span><span class="pl-p">];</span> <span class="pl-n">j</span> <span class="pl-o">&lt;=</span> <span class="pl-n">m</span><span class="pl-p">;</span> <span class="pl-n">j</span><span class="pl-o">++</span><span class="pl-p">)</span> <span class="pl-p">{</span>
                <span class="pl-n">f</span><span class="pl-p">[</span><span class="pl-n">j</span><span class="pl-p">]</span> <span class="pl-o">=</span> <span class="pl-n">max</span><span class="pl-p">(</span><span class="pl-n">f</span><span class="pl-p">[</span><span class="pl-n">j</span><span class="pl-p">],</span> <span class="pl-n">f</span><span class="pl-p">[</span><span class="pl-n">j</span> <span class="pl-o">-</span> <span class="pl-n">v</span><span class="pl-p">[</span><span class="pl-n">i</span><span class="pl-p">]]</span> <span class="pl-o">+</span> <span class="pl-n">w</span><span class="pl-p">[</span><span class="pl-n">i</span><span class="pl-p">]);</span>
            <span class="pl-p">}</span>
        <span class="pl-p">}</span> <span class="pl-k">else</span> <span class="pl-p">{</span>
            <span class="pl-kt">int</span> <span class="pl-n">t</span> <span class="pl-o">=</span> <span class="pl-n">c</span><span class="pl-p">[</span><span class="pl-n">i</span><span class="pl-p">];</span>
            <span class="pl-k">for</span> <span class="pl-p">(</span><span class="pl-kt">int</span> <span class="pl-n">k</span> <span class="pl-o">=</span> <span class="pl-mi">1</span><span class="pl-p">;</span> <span class="pl-n">k</span> <span class="pl-o">&lt;=</span> <span class="pl-n">t</span><span class="pl-p">;</span> <span class="pl-n">k</span> <span class="pl-o">&lt;&lt;=</span> <span class="pl-mi">1</span><span class="pl-p">)</span> <span class="pl-p">{</span>
                <span class="pl-n">t</span> <span class="pl-o">-=</span> <span class="pl-n">k</span><span class="pl-p">;</span>
                <span class="pl-k">for</span> <span class="pl-p">(</span><span class="pl-kt">int</span> <span class="pl-n">j</span> <span class="pl-o">=</span> <span class="pl-n">m</span><span class="pl-p">;</span> <span class="pl-n">j</span> <span class="pl-o">&gt;=</span> <span class="pl-n">k</span> <span class="pl-o">*</span> <span class="pl-n">v</span><span class="pl-p">[</span><span class="pl-n">i</span><span class="pl-p">];</span> <span class="pl-n">j</span><span class="pl-o">--</span><span class="pl-p">)</span> <span class="pl-p">{</span>
                    <span class="pl-n">f</span><span class="pl-p">[</span><span class="pl-n">j</span><span class="pl-p">]</span> <span class="pl-o">=</span> <span class="pl-n">max</span><span class="pl-p">(</span><span class="pl-n">f</span><span class="pl-p">[</span><span class="pl-n">j</span><span class="pl-p">],</span> <span class="pl-n">f</span><span class="pl-p">[</span><span class="pl-n">j</span> <span class="pl-o">-</span> <span class="pl-n">k</span> <span class="pl-o">*</span> <span class="pl-n">v</span><span class="pl-p">[</span><span class="pl-n">i</span><span class="pl-p">]]</span> <span class="pl-o">+</span> <span class="pl-n">k</span> <span class="pl-o">*</span> <span class="pl-n">w</span><span class="pl-p">[</span><span class="pl-n">i</span><span class="pl-p">]);</span>
                <span class="pl-p">}</span>
            <span class="pl-p">}</span>
            <span class="pl-k">if</span> <span class="pl-p">(</span><span class="pl-n">t</span><span class="pl-p">)</span> <span class="pl-p">{</span>
                <span class="pl-k">for</span> <span class="pl-p">(</span><span class="pl-kt">int</span> <span class="pl-n">j</span> <span class="pl-o">=</span> <span class="pl-n">m</span><span class="pl-p">;</span> <span class="pl-n">j</span> <span class="pl-o">&gt;=</span> <span class="pl-n">t</span> <span class="pl-o">*</span> <span class="pl-n">v</span><span class="pl-p">[</span><span class="pl-n">i</span><span class="pl-p">];</span> <span class="pl-n">j</span><span class="pl-o">--</span><span class="pl-p">)</span> <span class="pl-p">{</span>
                    <span class="pl-n">f</span><span class="pl-p">[</span><span class="pl-n">j</span><span class="pl-p">]</span> <span class="pl-o">=</span> <span class="pl-n">max</span><span class="pl-p">(</span><span class="pl-n">f</span><span class="pl-p">[</span><span class="pl-n">j</span><span class="pl-p">],</span> <span class="pl-n">f</span><span class="pl-p">[</span><span class="pl-n">j</span> <span class="pl-o">-</span> <span class="pl-n">t</span> <span class="pl-o">*</span> <span class="pl-n">v</span><span class="pl-p">[</span><span class="pl-n">i</span><span class="pl-p">]]</span> <span class="pl-o">+</span> <span class="pl-n">t</span> <span class="pl-o">*</span> <span class="pl-n">w</span><span class="pl-p">[</span><span class="pl-n">i</span><span class="pl-p">]);</span>
                <span class="pl-p">}</span>
            <span class="pl-p">}</span>
        <span class="pl-p">}</span>
    <span class="pl-p">}</span>
    <span class="pl-kt">int</span> <span class="pl-n">ans</span> <span class="pl-o">=</span> <span class="pl-mi">0</span><span class="pl-p">;</span>
    <span class="pl-k">for</span> <span class="pl-p">(</span><span class="pl-kt">int</span> <span class="pl-n">i</span> <span class="pl-o">=</span> <span class="pl-mi">0</span><span class="pl-p">;</span> <span class="pl-n">i</span> <span class="pl-o">&lt;=</span> <span class="pl-n">m</span><span class="pl-p">;</span> <span class="pl-n">i</span><span class="pl-o">++</span><span class="pl-p">)</span> <span class="pl-p">{</span>
        <span class="pl-n">ans</span> <span class="pl-o">=</span> <span class="pl-n">max</span><span class="pl-p">(</span><span class="pl-n">ans</span><span class="pl-p">,</span> <span class="pl-n">f</span><span class="pl-p">[</span><span class="pl-n">i</span><span class="pl-p">]);</span>
    <span class="pl-p">}</span>
    <span class="pl-n">printf</span><span class="pl-p">(</span><span class="pl-s">&quot;%lld</span><span class="pl-se">\n</span><span class="pl-s">&quot;</span><span class="pl-p">,</span> <span class="pl-n">ans</span><span class="pl-p">);</span>
<span class="pl-p">}</span>

编译信息

/sandbox/1/a.cpp:1:21: error: stray '#' in program
 <span class="pl-cp">#include</span> <span class="pl-cpf">&lt;iostream&gt;</span><span class="pl-cp"></span>
                     ^
/sandbox/1/a.cpp:2:21: error: stray '#' in program
 <span class="pl-cp">#include</span> <span class="pl-cpf">&lt;stdio.h&gt;</span><span class="pl-cp"></span>
                     ^
/sandbox/1/a.cpp:3:21: error: stray '#' in program
 <span class="pl-cp">#include</span> <span class="pl-cpf">&lt;string.h&gt;</span><span class="pl-cp"></span>
                     ^
/sandbox/1/a.cpp:4:21: error: stray '#' in program
 <span class="pl-cp">#define MAX_N 205</span>
                     ^
/sandbox/1/a.cpp:5:21: error: stray '#' in program
 <span class="pl-cp">#define MAX_M 200005</span>
                     ^
/sandbox/1/a.cpp:6:21: error: stray '#' in program
 <span class="pl-cp">#define int long long</span>
                     ^
/sandbox/1/a.cpp:45:120: error: stray '\' in program
     <span class="pl-n">printf</span><span class="pl-p">(</span><span class="pl-s">&quot;%lld</span><span class="pl-se">\n</span><span class="pl-s">&quot;</span><span class="pl-p">,</span> <span class="pl-n">ans</span><span class="pl-p">);</span>
                                                                                                                        ^
/sandbox/1/a.cpp:1:1: error: expected unqualified-id before '<' token
 <span class="pl-cp">#include</span> <span class="pl-cpf">&lt;iostream&gt;</span><span class="pl-cp"></span>
 ^
/sandbox/1/a.cpp:1:62: error: 'iostream' does not name a type
 <span class="pl-cp">#include</span> <span class="pl-cpf">&lt;iostream&gt;</span><span class="pl-cp"></span>
                                                              ^~~~~~~~
/sandbox/1/a.cpp:1:74: error: expected unqualified-id before '<' token
 <span class="pl-cp">#include</span> <span class="pl-cpf">&lt;iostream&gt;</span><span class="pl-cp"></span>
                                                                          ^
/sandbox/1/a.cpp:2:62: error: 'stdio' does not name a type; did you mean 'std'?
 <span class="pl-cp">#include</span> <span class="pl-cpf">&lt;stdio.h&gt;</span><span class="pl-cp"></span>
                                                              ^~~~~
                                                              std
/sandbox/1/a.cpp:2:73: error: expected unqualified-id before '<' token
 <span class="pl-cp">#include</span> <span class="pl-cpf">&lt;stdio.h&gt;</span><span class="pl-cp"></span>
                                                                         ^
/sandbox/1/a.cpp:3:62: error: 'string' does not name a type; did you mean 'struct'?
 <span class="pl-cp">#include</span> <span class="pl-cpf">&lt;string.h&gt;</span><span class="pl-cp"></span>
                                                              ^~~~~~
                                                              struct
/sandbox/1/a.cpp:3:74: error: expected unqualified-id before '<' token
 <span class="pl-cp">#include</span> <span class="pl-cpf">&lt;string.h&gt;</span><span class="pl-cp"></span>
                                                                          ^
/sandbox/1/a.cpp:8:118: error: expected unqualified-id before '<' token
 <span class="pl-k">using</span> <span class="pl-k">namespace</span> <span class="pl-n">std</span><span class="pl-p">;</span>
                                                                                                                      ^
/sandbox/1/a.cpp:10:134: error: expected unqualified-id before '<' token
 <span class="pl-kt">int</span> <span class="pl-n">n</span><span class="pl-p">,</span> <span class="pl-n">m</span><span class="pl-p">;</span>
                                                                                                                                      ^
/sandbox/1/a.cpp:11:138: error: expected unqualified-id before '<' token
 <span class="pl-kt">int</span> <span class="pl-n">v</span><span class="pl-p">[</span><span class="pl-n">MAX_N</span><span class="pl-p">];</span>
                                                                                                                                          ^
/sandbox/1/a.cpp:12:138: error: expected unqualified-id before '<' token
 <span class="pl-kt">int</span> <span class="pl-n">w</span><span class="pl-p">[</span><span class="pl-n">MAX_N</span><span class="pl-p">];</span>
                                                                                                                                          ^
/sandbox/1/a.cpp:13:138: error: expected unqualified-id before '<' token
 <span class="pl-kt">int</span> <span class="pl-n">c</span><span class="pl-p">[</span><span class="pl-n">MAX_N</span><span class="pl-p">];</span>
                                                                                                                                          ^
/sandbox/1/a.cpp:14:138: error: expected unqualified-id before '<' token
 <span class="pl-kt">int</span> <span class="pl-n">f</span><span class="pl-p">[</span><span class="pl-n">MAX_M</span><span class="pl-p">];</span>
                                                                                                                                          ^
/sandbox/1/a.cpp:46:21: error: expected unqualified-id before '<' token
 <span class="pl-p">}</span>
                     ^