Submission #2244987
Source Code Expand
import java.io.*; import java.util.*; class Main{ public static void main(String[] args){ solve(); } public static void solve(){ Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int k = sc.nextInt(); long count = 0; if(n==0){ count = n*n; } else{ for(int i=2;i<=n;i++){ for(int j=1;j<i;j++){ if(i%j>=k){ count++; } } } count += (n-k)*(n-k+1)/2; } System.out.println(count); } }
Submission Info
Submission Time | |
---|---|
Task | D - Remainder Reminder |
User | amyu47 |
Language | Java8 (OpenJDK 1.8.0) |
Score | 0 |
Code Size | 486 Byte |
Status | TLE |
Exec Time | 2108 ms |
Memory | 23892 KB |
Judge Result
Set Name | Sample | All | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 400 | ||||||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | s1.txt, s2.txt, s3.txt |
All | 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, s1.txt, s2.txt, s3.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
01.txt | TLE | 2108 ms | 19924 KB |
02.txt | TLE | 2108 ms | 22356 KB |
03.txt | TLE | 2108 ms | 17108 KB |
04.txt | TLE | 2108 ms | 19924 KB |
05.txt | TLE | 2108 ms | 23892 KB |
06.txt | TLE | 2108 ms | 19924 KB |
07.txt | TLE | 2108 ms | 19412 KB |
08.txt | TLE | 2108 ms | 21460 KB |
09.txt | TLE | 2108 ms | 16980 KB |
10.txt | AC | 92 ms | 18004 KB |
11.txt | AC | 90 ms | 20820 KB |
s1.txt | AC | 91 ms | 21204 KB |
s2.txt | AC | 89 ms | 18900 KB |
s3.txt | TLE | 2061 ms | 21972 KB |