結果
| 問題 |
No.1686 Geschenkt
|
| コンテスト | |
| ユーザー |
noya2
|
| 提出日時 | 2021-07-18 17:50:14 |
| 言語 | C++17(gcc12) (gcc 12.3.0 + boost 1.87.0) |
| 結果 |
CE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 523 bytes |
| コンパイル時間 | 248 ms |
| コンパイル使用メモリ | 25,088 KB |
| 最終ジャッジ日時 | 2025-01-23 03:10:10 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
コンパイルメッセージ
main.cpp:1:10: fatal error: testlib.h: No such file or directory
1 | #include "testlib.h"
| ^~~~~~~~~~~
compilation terminated.
ソースコード
#include "testlib.h"
#include<bits/stdc++.h>
using namespace std;
int main(){
registerValidation();
int n = inf.readInt(1,33,"n");
inf.readEoln();
vector<int> ar(n);
for (int i = 0; i < n ; i++){
int c = inf.readInt(3,35,"c");
ar[i] = c;
if (i == n-1) inf.readEoln();
else inf.readSpace();
}
sort(ar.begin(),ar.end());
int ans = ar[0];
for (int i = 1; i < n; i++){
assert(ar[i-1] < ar[i]);
if (ar[i-1] + 1 != ar[i]) ans += ar[i];
}
cout << ans << endl;
inf.readEof();
return 0;
}
noya2