Submission #00182


ソースコード

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
#include <bits/stdc++.h>
using namespace std;
int n, a[111111], b[111111], sum = 0;
double keta1, keta2, ten = 10, p;
int main()
{
cin >> n;
for (int i = 0; i < n; i++) {
cin >> a[i] >> b[i];
sum += b[i];
keta1 = (int)log10((double)a[i]) + 1;
for (int j = 0; j < i; j++) {
keta2 = (int)log10((double)a[j]) + 1;
p = pow(ten, keta2);
//cout << keta2 << endl;
if (a[j] - a[i] == 0 || abs(a[j] - a[i]) % (int)p == 0 && keta1 != keta2 && keta1 != 1) {
sum += b[j];
}
else if (keta1 == 1 && abs(a[j] - a[i]) % 10 == 0) {
sum += b[j];
}
}
cout << sum << endl;
sum = 0;
}
}

ステータス

項目 データ
問題 0008 - 宝くじ
ユーザー名 便座オブパンツァー
投稿日時 2015-08-28 11:56:43
言語 C++11
状態 Time Limit Exceeded
得点 0
ソースコード長 692 Byte
最大実行時間 5000 ms
最大メモリ使用量 3080 KB

セット

セット 得点 Cases
1 ALL 0 / 30 *

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
scrambled_00.txt AC 19 ms 472 KB
1
scrambled_01.txt AC 14 ms 576 KB
1
scrambled_02.txt TLE 5000 ms 800 KB
1
scrambled_03.txt TLE 5000 ms 940 KB
1
scrambled_04.txt TLE 5000 ms 1080 KB
1
scrambled_05.txt TLE 5000 ms 1096 KB
1
scrambled_06.txt TLE 5000 ms 1112 KB
1
scrambled_07.txt TLE 5000 ms 1132 KB
1
scrambled_08.txt TLE 5000 ms 1276 KB
1
scrambled_09.txt TLE 5000 ms 1412 KB
1
scrambled_10.txt TLE 5000 ms 1684 KB
1
scrambled_11.txt TLE 5000 ms 1828 KB
1
scrambled_12.txt TLE 5000 ms 1844 KB
1
scrambled_13.txt TLE 5000 ms 1988 KB
1
scrambled_14.txt TLE 5000 ms 2128 KB
1
scrambled_15.txt WA 623 ms 2136 KB
1
scrambled_16.txt TLE 5000 ms 2328 KB
1
scrambled_17.txt TLE 5000 ms 2336 KB
1
scrambled_18.txt TLE 5000 ms 2472 KB
1
scrambled_19.txt TLE 5000 ms 2604 KB
1
scrambled_20.txt TLE 5000 ms 2752 KB
1
scrambled_21.txt TLE 5000 ms 2900 KB
1
scrambled_22.txt TLE 5000 ms 2920 KB
1
scrambled_23.txt TLE 5000 ms 2936 KB
1
scrambled_24.txt TLE 5000 ms 3080 KB
1