Submission #442199

#TimeUsernameProblemLanguageResultExecution timeMemory
442199Yazan_AlattarAliens (IOI16_aliens)C++17
Compilation error
0 ms0 KiB
#include <iostream> #include <fstream> #include <vector> #include <cstring> #include <algorithm> #include <set> #include <map> #include <queue> #include <utility> #include <cmath> #include <numeric> using namespace std; typedef long long ll; #define F first #define S second #define pb push_back #define endl "\n" const int M = 1005; const int mod = 1e9+7; bool a[M][M], vist[M][M]; int ans; long long take_photos(int n, int m, int k, int[] r, int[] c) { for(int i = 0; i < n; ++i){ if(vist[r[i]][c[i]]) continue; vist[r[i]][c[i]] = 1; ++ans; } return ans; } /* int main() { //ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); vector <int> r, c; int n, m, k; cin >> n >> m >> k; for(int i = 0; i < n; ++i){ int x; cin >> x; r.pb(x); } for(int i = 0; i < n; ++i){ int x; cin >> x; c.pb(x); } cout << take_photos(n, m, k, r, c); return 0; } */

Compilation message (stderr)

aliens.cpp:23:50: error: expected ',' or '...' before 'r'
   23 | long long take_photos(int n, int m, int k, int[] r, int[] c)
      |                                                  ^
aliens.cpp: In function 'long long int take_photos(int, int, int, int*)':
aliens.cpp:26:17: error: 'r' was not declared in this scope
   26 |         if(vist[r[i]][c[i]]) continue;
      |                 ^
aliens.cpp:26:23: error: 'c' was not declared in this scope
   26 |         if(vist[r[i]][c[i]]) continue;
      |                       ^
aliens.cpp:27:14: error: 'r' was not declared in this scope
   27 |         vist[r[i]][c[i]] = 1;
      |              ^
aliens.cpp:27:20: error: 'c' was not declared in this scope
   27 |         vist[r[i]][c[i]] = 1;
      |                    ^