Submission #37254


ソースコード

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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
import java.io.*;
import java.util.*;
import java.lang.*;
import java.math.*;
class Main{
public static void main(String args[]){
int n = FastScanner.nextInt();
int[] p = new int[n+1];
int i;
for ( i = 1; i <= n; i++ ) {
p[i] = p[i-1] + FastScanner.nextInt();
}
int m = FastScanner.nextInt();
for ( i = 0; i < m; i++ ) {
print( -1 * p[FastScanner.nextInt()-1] + p[FastScanner.nextInt()]);
}
}
/*
static int getInt(){
return Integer.parseInt(scan.next());
}
static String getStr(){
return scan.next();
}
static String getLine(){
return scan.nextLine();
}
static char getChar(){
return getStr().charAt(0);
}
static long getLong(){
return Long.parseLong(scan.next());
}
static double getDouble(){
return Double.parseDouble(scan.next());
}
static BigInteger getBig(){
return scan.nextBigInteger();
}*/
static void print(Object a){
System.out.println(a);
}
static void printf(Object a){
System.out.print(a);
}
}
class FastScanner {
private static final InputStream in = System.in;
private static final byte[] buffer = new byte[1024];
private static int ptr = 0;
private static int buflen = 0;
private static boolean hasNextByte() {
if (ptr < buflen) {
return true;
}else{
ptr = 0;
try {
buflen = in.read(buffer);
} catch (IOException e) {
e.printStackTrace();
}
if (buflen <= 0) {
return false;
}
}
return true;
}
private static int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
public static boolean hasNext() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; return hasNextByte();}
public static String next() {
if (!hasNext()) throw new NoSuchElementException();
StringBuilder sb = new StringBuilder();
int b = readByte();
while(isPrintableChar(b)) {
sb.appendCodePoint(b);
b = readByte();
}
return sb.toString();
}
static public long nextLong() {
if (!hasNext()) throw new NoSuchElementException();
long n = 0;
boolean minus = false;
int b = readByte();
if (b == '-') {
minus = true;
b = readByte();
}
if (b < '0' || '9' < b) {
throw new NumberFormatException();
}
while(true){
if ('0' <= b && b <= '9') {
n *= 10;
n += b - '0';
}else if(b == -1 || !isPrintableChar(b)){
return minus ? -n : n;
}else{
throw new NumberFormatException();
}
b = readByte();
}
}
public static int nextInt() {
long nl = nextLong();
if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();
return (int) nl;
}
public static double nextDouble() { return Double.parseDouble(next());}
}

ステータス

項目 データ
問題 0719 - 魔女っ娘ヒナくるん -Magic.01
ユーザー名 r1825
投稿日時 2018-06-13 20:29:39
言語 Java
状態 Accepted
得点 10
ソースコード長 3429 Byte
最大実行時間 548 ms
最大メモリ使用量 62096 KB

セット

セット 得点 Cases
1 Hina 2 / 2 Magic0*, Magic10
2 Hinakurun birthed. 8 / 8 *

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
Magic01 AC 76 ms 13868 KB
1
2
Magic02 AC 74 ms 14272 KB
1
2
Magic03 AC 80 ms 15860 KB
1
2
Magic04 AC 75 ms 13952 KB
1
2
Magic05 AC 73 ms 13936 KB
1
2
Magic06 AC 87 ms 12416 KB
1
2
Magic07 AC 80 ms 14204 KB
1
2
Magic08 AC 76 ms 14112 KB
1
2
Magic09 AC 90 ms 12848 KB
1
2
Magic10 AC 79 ms 12636 KB
1
2
Magic11 AC 536 ms 32588 KB
2
Magic12 AC 522 ms 31320 KB
2
Magic13 AC 503 ms 31964 KB
2
Magic14 AC 534 ms 31012 KB
2
Magic15 AC 506 ms 33396 KB
2
Magic16 AC 543 ms 33028 KB
2
Magic17 AC 506 ms 35048 KB
2
Magic18 AC 520 ms 34328 KB
2
Magic19 AC 525 ms 35156 KB
2
Magic20 AC 510 ms 37188 KB
2
Magic21 AC 501 ms 38704 KB
2
Magic22 AC 539 ms 40676 KB
2
Magic23 AC 508 ms 40432 KB
2
Magic24 AC 505 ms 39340 KB
2
Magic25 AC 521 ms 41936 KB
2
Magic26 AC 525 ms 43496 KB
2
Magic27 AC 522 ms 44780 KB
2
Magic28 AC 523 ms 45656 KB
2
Magic29 AC 538 ms 43836 KB
2
Magic30 AC 525 ms 43496 KB
2
Magic31 AC 520 ms 45036 KB
2
Magic32 AC 513 ms 45684 KB
2
Magic33 AC 512 ms 49320 KB
2
Magic34 AC 507 ms 48728 KB
2
Magic35 AC 514 ms 49964 KB
2
Magic36 AC 508 ms 51788 KB
2
Magic37 AC 504 ms 52280 KB
2
Magic38 AC 510 ms 51308 KB
2
Magic39 AC 520 ms 50260 KB
2
Magic40 AC 517 ms 51628 KB
2
Magic41 AC 518 ms 54792 KB
2
Magic42 AC 512 ms 55504 KB
2
Magic43 AC 534 ms 57328 KB
2
Magic44 AC 543 ms 56956 KB
2
Magic45 AC 507 ms 57068 KB
2
Magic46 AC 548 ms 59064 KB
2
Magic47 AC 514 ms 60552 KB
2
Magic48 AC 531 ms 58084 KB
2
Magic49 AC 524 ms 62096 KB
2
Magic50 AC 543 ms 60920 KB
2