# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
472020 |
2021-09-12T11:14:18 Z |
hjc4vr |
Baloni (COCI15_baloni) |
C++17 |
|
0 ms |
0 KB |
/#include <bits/stdc++.h>
#define int long long
#define pp pair <bool,int>
#define ppi pair <int,int>
#define tp tuple <int,int,int,bool>
#define c1(x) cin >> x
#define c2(x,y) cin >> x >> y
#define c3(x,y,z) cin >> x >> y >> z
#define c4(x,y,z,f) cin>> x >> y >> z >> f
#define mp(a,b) make_pair(a,b)
using namespace std;
void solve(){
int n;cin>>n;
unordered_map<int,bool> mp;
for (int i=0;i<n;++i){
int a;cin>>a;
mp[a+i] = true;
}
cout << mp.size();
}
int32_t main(){
ios_base::sync_with_stdio(0);cin.tie(0);
solve();
}
// 1 6 9 3 4 10 3 9
Compilation message
baloni.cpp:1:2: error: stray '#' in program
1 | /#include <bits/stdc++.h>
| ^
baloni.cpp:1:1: error: expected unqualified-id before '/' token
1 | /#include <bits/stdc++.h>
| ^
baloni.cpp: In function 'void solve()':
baloni.cpp:14:11: error: 'cin' was not declared in this scope
14 | int n;cin>>n;
| ^~~
baloni.cpp:15:5: error: 'unordered_map' was not declared in this scope
15 | unordered_map<int,bool> mp;
| ^~~~~~~~~~~~~
baloni.cpp:2:13: error: expected primary-expression before 'long'
2 | #define int long long
| ^~~~
baloni.cpp:15:19: note: in expansion of macro 'int'
15 | unordered_map<int,bool> mp;
| ^~~
baloni.cpp:18:9: error: 'mp' was not declared in this scope
18 | mp[a+i] = true;
| ^~
baloni.cpp:20:5: error: 'cout' was not declared in this scope
20 | cout << mp.size();
| ^~~~
baloni.cpp:20:13: error: 'mp' was not declared in this scope
20 | cout << mp.size();
| ^~
baloni.cpp: At global scope:
baloni.cpp:24:1: error: 'int32_t' does not name a type
24 | int32_t main(){
| ^~~~~~~