結果
| 問題 |
No.1686 Geschenkt
|
| コンテスト | |
| ユーザー |
goteten
|
| 提出日時 | 2021-09-24 21:22:28 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 418 bytes |
| コンパイル時間 | 1,355 ms |
| コンパイル使用メモリ | 171,024 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-05 09:56:43 |
| 合計ジャッジ時間 | 1,826 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 7 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define all(x) (x).begin(),(x).end()
const int mod = 1000000007;
const long long INF = 1LL << 60;
using ll = long long;
int main()
{
int N;
cin >> N;
set<int> se;
rep(i,N){
int a;
cin >> a;
se.insert(a);
}
int ans=0;
for(auto x:se){
if(!se.count(x-1)) ans+=x;
}
cout << ans << endl;
}
goteten