QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#137989#6342. Security GuardRafi22#0 7ms5276kbC++14696b2023-08-10 20:19:182024-07-04 01:33:37

Judging History

你现在查看的是最新测评结果

  • [2024-07-04 01:33:37]
  • 评测
  • 测评结果:0
  • 用时:7ms
  • 内存:5276kb
  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-08-10 20:19:18]
  • 提交

answer

#include <bits/stdc++.h>

#define int long long
#define ll long long
#define ld long double
#define endl '\n'
#define st first
#define nd second
#define pb push_back
#define sz(x) (int)(x).size()
#define all(x) (x).begin(), (x).end()
using namespace std;
int inf=2000000007;
int mod=1000000007;
int mod1=998244353;

const int N=200007;

int a[N];

signed main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int n,m,k;
    cin>>n>>m>>k;
    bool is=0;
    int ans=0;
    for(int i=1;i<=n;i++)
    {
        cin>>a[i];
        if(i>1) ans+=min(a[i],a[i-1]);
        ans+=max(0LL,a[i]-a[i-1]);
    }
    cout<<ans;

    return 0;
}

詳細信息

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 0
Wrong Answer
time: 7ms
memory: 5276kb

input:

200000 199999 0
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...

output:

200000

result:

wrong answer 1st numbers differ - expected: '199999', found: '200000'

Subtask #2:

score: 0
Skipped

Dependency #1:

0%

Subtask #3:

score: 0
Skipped

Dependency #2:

0%

Subtask #4:

score: 0
Skipped

Dependency #3:

0%

Subtask #5:

score: 0
Wrong Answer

Test #85:

score: 0
Wrong Answer
time: 0ms
memory: 3716kb

input:

16 15 200000
692461146 622302385 805066691 422290641 600839873 940930580 873147413 489653843 239129952 383473127 21389393 913787109 856138328 859082963 262475462 327598064
6 13
6 9
6 15
6 14
6 16
6 8
5 6
1 6
4 6
3 6
6 11
6 7
6 10
2 6
6 12

output:

9309766970

result:

wrong answer 1st numbers differ - expected: '14113958700', found: '9309766970'

Subtask #6:

score: 0
Skipped

Dependency #5:

0%

Subtask #7:

score: 0
Skipped

Dependency #1:

0%