提出 #548539
ソースコード 拡げる
import java.util.*;
public class Main{
static Scanner sc = new Scanner(System.in);
int N;
void run(){
N = sc.nextInt();
int[] black = new int[100010];
for(int i = 0;i < black.length;i++){
black[i] = -1;
}
for(int i = 0;i < N;i++){
int s = sc.nextInt();
int c = sc.nextInt();
int counter = 0;
while(true){
if(black[s] != -1){
s += black[s];
}else{
black[s] = c - counter;
counter += 1;
s += 1;
}
if(counter == c){
break;
}
}
System.out.println(s-1);
}
}
public static void main(String[] args){
new Main().run();
}
}
提出情報
| 提出日時 | |
|---|---|
| 問題 | D - マスと駒と色塗り |
| ユーザ | fshin |
| 言語 | Java (OpenJDK 1.7.0) |
| 得点 | 0 |
| コード長 | 729 Byte |
| 結果 | TLE |
| 実行時間 | 2056 ms |
| メモリ | 39860 KiB |
ジャッジ結果
| セット名 | Sample | Dataset1 | Dataset2 | Dataset3 | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 得点 / 配点 | 0 / 0 | 0 / 35 | 0 / 40 | 0 / 25 | ||||||||||||||||||
| 結果 |
|
|
|
|
| セット名 | テストケース |
|---|---|
| Sample | sample-01.txt, sample-02.txt, sample-03.txt |
| Dataset1 | sample-01.txt, sample-02.txt, 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, 01-05.txt, 01-06.txt, 01-07.txt, 01-08.txt, 01-09.txt |
| Dataset2 | sample-01.txt, sample-02.txt, sample-03.txt, 02-01.txt, 02-02.txt, 02-03.txt, 02-04.txt, 02-05.txt, 02-06.txt, 02-07.txt, 02-08.txt, 02-09.txt, 02-10.txt, 02-11.txt, 02-12.txt |
| Dataset3 | sample-01.txt, sample-02.txt, sample-03.txt, 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, 01-05.txt, 01-06.txt, 01-07.txt, 01-08.txt, 01-09.txt, 02-01.txt, 02-02.txt, 02-03.txt, 02-04.txt, 02-05.txt, 02-06.txt, 02-07.txt, 02-08.txt, 02-09.txt, 02-10.txt, 02-11.txt, 02-12.txt, 03-01.txt, 03-02.txt, 03-03.txt, 03-04.txt, 03-05.txt, 03-06.txt, 03-07.txt, 03-08.txt, 03-09.txt, 03-10.txt, 03-11.txt, 03-12.txt |
| ケース名 | 結果 | 実行時間 | メモリ |
|---|---|---|---|
| 01-01.txt | TLE | 2055 ms | 39720 KiB |
| 01-02.txt | TLE | 2056 ms | 39060 KiB |
| 01-03.txt | TLE | 2043 ms | 39620 KiB |
| 01-04.txt | AC | 1732 ms | 39616 KiB |
| 01-05.txt | AC | 429 ms | 24688 KiB |
| 01-06.txt | AC | 445 ms | 26348 KiB |
| 01-07.txt | AC | 619 ms | 27892 KiB |
| 01-08.txt | AC | 1473 ms | 39692 KiB |
| 01-09.txt | TLE | 2038 ms | 39860 KiB |
| 02-01.txt | RE | 424 ms | 24784 KiB |
| 02-02.txt | RE | 413 ms | 24872 KiB |
| 02-03.txt | RE | 410 ms | 24888 KiB |
| 02-04.txt | AC | 579 ms | 28068 KiB |
| 02-05.txt | RE | 415 ms | 24932 KiB |
| 02-06.txt | RE | 427 ms | 24880 KiB |
| 02-07.txt | RE | 413 ms | 24884 KiB |
| 02-08.txt | RE | 413 ms | 24800 KiB |
| 02-09.txt | RE | 412 ms | 24756 KiB |
| 02-10.txt | RE | 410 ms | 24880 KiB |
| 02-11.txt | RE | 413 ms | 24756 KiB |
| 02-12.txt | RE | 412 ms | 25004 KiB |
| 03-01.txt | RE | 415 ms | 24880 KiB |
| 03-02.txt | RE | 413 ms | 24884 KiB |
| 03-03.txt | RE | 408 ms | 24848 KiB |
| 03-04.txt | TLE | 2049 ms | 39676 KiB |
| 03-05.txt | RE | 421 ms | 24896 KiB |
| 03-06.txt | RE | 422 ms | 24924 KiB |
| 03-07.txt | RE | 430 ms | 25012 KiB |
| 03-08.txt | RE | 424 ms | 24888 KiB |
| 03-09.txt | RE | 418 ms | 24760 KiB |
| 03-10.txt | RE | 420 ms | 24940 KiB |
| 03-11.txt | RE | 428 ms | 24892 KiB |
| 03-12.txt | RE | 414 ms | 24916 KiB |
| sample-01.txt | AC | 411 ms | 24652 KiB |
| sample-02.txt | AC | 402 ms | 24684 KiB |
| sample-03.txt | RE | 409 ms | 24812 KiB |