제출 #601137

#제출 시각아이디문제언어결과실행 시간메모리
601137MohamedAliSaidaneAliens (IOI16_aliens)C++14
0 / 100
1 ms300 KiB
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include "aliens.h" using namespace std; using namespace __gnu_pbds; ///#define int long long typedef tree<int,null_type,less<int>,rb_tree_tag, tree_order_statistics_node_update> indexed_set; typedef long long ll; typedef pair<int,int> pii; typedef pair<ll,ll> pll; typedef vector<int> vi; typedef vector<ll> vll; typedef vector<pii> vpi; typedef vector<pll> vpl; #define ff first #define ss second #define pb push_back #define popb pop_back #define all(x) (x).begin(),(x).end() const ll INF = 1e18; ll take_photos(int n, int m, int k, vi r, vi c) { int grid[m + 1][m + 1]; memset(grid,0,sizeof(grid)); for(int i = 0 ; i < n;i ++) { int l = abs(r[i] - c[i]) + 1; for(int u = r[i]; u < r[i] + l; u ++) { if(c[i] < r[i]) { for(int j = c[i]; j < c[i] + l; j ++) grid[i][j] = 1; } else { for(int j= r[i]; j < r[i] + l; j ++) grid[i][j] = 1; } } } int ans = 0 ; for(int i = 0; i <= m; i ++) for(int j= 0 ; j <= m; j ++) ans += grid[i][j]; return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...