Skip to content

Commit

Permalink
🎨 style: improve structure of the code
Browse files Browse the repository at this point in the history
  • Loading branch information
liuchuo committed Apr 17, 2019
1 parent 6ce392d commit 759688a
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions AdvancedLevel_C++/1105. Spiral Matrix (25).cpp
Original file line number Diff line number Diff line change
@@ -1,23 +1,18 @@
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <algorithm>
using namespace std;
int func(int N) {
int i = sqrt((double)N);
while(i >= 1) {
if(N % i == 0)
return i;
i--;
}
return 1;
}
int cmp(int a, int b) {return a > b;}
int main() {
int N, m, n, t = 0;
scanf("%d", &N);
n = func(N);
m = N / n;
for (n = sqrt((double)N); n >= 1; n--) {
if (N % n == 0) {
m = N / n;
break;
}
}
vector<int> a(N);
for (int i = 0; i < N; i++)
scanf("%d", &a[i]);
Expand Down

0 comments on commit 759688a

Please sign in to comment.