1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
| #include <string>
#include <vector>
#include <iostream>
using namespace std;
vector<int> solution(int n, long long left, long long right) {
vector<int> answer;
for(long long i=left;i<=right;i++){//여기 long long 안해서 계속 시간초과,.........
int x,y;
x=i/n+1;
y=i%n+1;
answer.push_back(x>y?x:y);
}
return answer;
}
|