Submission #425645

#TimeUsernameProblemLanguageResultExecution timeMemory
425645ngraceAliens (IOI16_aliens)C++14
4 / 100
2 ms288 KiB
#include "aliens.h" #include <vector> #include <iostream> #include <utility> using namespace std; #define v vector #define pii pair<int,int> #define fi first #define se second v<v<v<int>>> memo; long long take_photos(int n, int m, int k, std::vector<int> r, std::vector<int> c) { if(k==n && m<=100){//sub 1 v<v<bool>> squares(m,v<bool>(m,false)); for(int i=0;i<n;i++){ int low=min(r[i],c[i]); int high=max(r[i],c[i]); for(int a=low;a<=high;a++){ for(int b=low;b<=high;b++){ squares[a][b]=true; } } } long long out=0; for(int i=0;i<m;i++){ for(int j=0;j<m;j++){ out+=squares[i][j]; } } return out; } else{//assume sub 2 //as all along diagonal can do dp with n^3 } }

Compilation message (stderr)

aliens.cpp: In function 'long long int take_photos(int, int, int, std::vector<int>, std::vector<int>)':
aliens.cpp:39:1: warning: control reaches end of non-void function [-Wreturn-type]
   39 | }
      | ^
#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...