Submission #1996908
Source Code Expand
/*{{{*/
#include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <sstream>
#include <functional>
#include <map>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <deque>
#include <stack>
#include <deque>
#include <set>
#include <list>
#include <numeric>
#include <time.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
const double PIE = 3.141592;
#define rep_n(i, a, b) for (int i=a; i<b; i++)
#define rep(i, n) rep_n(i, 0, n)
#define all(v) (v).begin(), (v).end()
#define item(v) sizeof(v)/sizeof(v[0])
#define tov(v) v, v+item(v)
#define mp(x, y) make_pair(x, y)
#define mset(x, y) memset(x, y, sizeof(x))
#define chmin(x,y) (x=min(x, y))
#define chmax(x,y) (x=max(x, y))
#define SORTI(v) sort(v, v+item(v))
#define SORT(v) sort(d.begin(), d.end());
#define UNIQUE(x) x.erase(unique(all(x)), x.end())
#define ins(x, y, z) x.insert(x.begin()+y, z)
#define era(x, y) x.erase(x.begin()+y)
#define era1(x, y, z) x.erase(x.begin()+y, x.begin()+z)
#define COUNT(x, y) count(all(x), y)
#define FIND(x, y) find(all(x), y) - x.begin()
#define BIT(x, y) (x>>y&1)
#define ASSIGN(x, y) x.assign(&a[0], &a[item(a)-1])
#define ci1(a) cin>>a
#define ci2(a, b) cin>>a>>b
#define ci3(a, b, c) cin>>a>>b>>c
#define ci4(a, b, c, d) cin>>a>>b>>c>>d
#define co1(a) cout<<a<<endl;
#define co2(a, b) cout<<a<<" "<<b<<endl;
#define co3(a, b, c) cout<<a<<" "<<b<<" "<<c<<endl;
#define co4(a, b, c, d) cout<<a<<" "<<b<<" "<<c<<" "<<d<<endl;
/*}}}*/
int maxx=INT_MIN, minx=INT_MAX;
ll x, y, z, ans;
vector<ll> v;
int main() {
ci1(x);
vector<ll> a(pow(10, 9)), b(pow(10, 9));
ans=0;
rep(i, x) {
ci1(a[i]);
b[a[i]]+=1;
if (b[a[i]]>a[i] || b[a[i]]<a[i]) ans++;
if (b[a[i]]==a[i]) ans-=(a[i]-1);
}
co1(ans);
}
///*debug*/co1();
Submission Info
Submission Time |
|
Task |
C - Good Sequence |
User |
eryuk888 |
Language |
C++14 (GCC 5.4.1) |
Score |
0 |
Code Size |
2198 Byte |
Status |
RE |
Exec Time |
99 ms |
Memory |
256 KB |
Judge Result
Set Name |
Sample |
All |
Score / Max Score |
0 / 0 |
0 / 300 |
Status |
|
|
Set Name |
Test Cases |
Sample |
0_00.txt, 0_01.txt, 0_02.txt, 0_03.txt, 0_04.txt |
All |
0_00.txt, 0_01.txt, 0_02.txt, 0_03.txt, 0_04.txt, 1_00.txt, 1_01.txt, 1_02.txt, 1_03.txt, 1_04.txt, 1_05.txt, 1_06.txt, 1_07.txt, 1_08.txt, 1_09.txt, 1_10.txt, 1_11.txt, 1_12.txt |
Case Name |
Status |
Exec Time |
Memory |
0_00.txt |
RE |
98 ms |
256 KB |
0_01.txt |
RE |
98 ms |
256 KB |
0_02.txt |
RE |
97 ms |
256 KB |
0_03.txt |
RE |
99 ms |
256 KB |
0_04.txt |
RE |
97 ms |
256 KB |
1_00.txt |
RE |
97 ms |
256 KB |
1_01.txt |
RE |
96 ms |
256 KB |
1_02.txt |
RE |
96 ms |
256 KB |
1_03.txt |
RE |
99 ms |
256 KB |
1_04.txt |
RE |
96 ms |
256 KB |
1_05.txt |
RE |
96 ms |
256 KB |
1_06.txt |
RE |
96 ms |
256 KB |
1_07.txt |
RE |
96 ms |
256 KB |
1_08.txt |
RE |
96 ms |
256 KB |
1_09.txt |
RE |
97 ms |
256 KB |
1_10.txt |
RE |
99 ms |
256 KB |
1_11.txt |
RE |
99 ms |
256 KB |
1_12.txt |
RE |
97 ms |
256 KB |