일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- API
- sort
- token filter test
- licence delete curl
- ELASTIC
- zip 암호화
- Java
- license delete
- 차트
- 900gle
- zip 파일 암호화
- aggs
- plugin
- 파이썬
- Test
- Kafka
- TensorFlow
- high level client
- springboot
- MySQL
- flask
- Python
- matplotlib
- docker
- License
- query
- Elasticsearch
- analyzer test
- Mac
- aggregation
Archives
- Today
- Total
개발잡부
[groom] 구름이의 취미 본문
반응형


double 대신 long 으로 풀어야 하고
Math.pow 도 안쓰고 곱하니까 되네
package groom;
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class Hobby {
public static void main(String[] args) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String input = br.readLine();
long n = Long.parseLong(input);
long sum = (n * (n + 1) / 2) % 1000000007;
long ret = (sum * sum) % 1000000007;
System.out.println((int) ret);
}
}
반응형
'이직' 카테고리의 다른 글
[programmers] 같은 숫자는 싫어 (0) | 2022.08.28 |
---|---|
[codility] Dominator (0) | 2022.08.08 |
TwoSum (0) | 2022.07.27 |
hadoop 준비 (1) | 2022.07.27 |
[codility] Nesting (0) | 2022.07.26 |