Code Submission Evaluation System Login

Datatähti 2018 alku

Start:2017-10-02 00:00:00
End:2017-10-16 00:00:00
 

Tasks | Messages | Scoreboard | Statistics


CSES - Datatähti 2018 alku - Results
History
2017-10-06 20:29:36100
2017-10-06 20:28:590
2017-10-06 20:19:5037
2017-10-06 20:17:21
2017-10-06 20:15:33
2017-10-06 16:23:0137
2017-10-06 16:22:240
2017-10-06 16:20:500
2017-10-06 16:17:400
2017-10-06 15:49:2137
2017-10-06 15:45:3137
2017-10-04 21:43:440
2017-10-04 21:42:4537
2017-10-04 18:52:1237
2017-10-04 18:15:330
2017-10-04 17:18:350
2017-10-04 17:17:11
2017-10-04 14:01:5637
2017-10-04 13:59:25
2017-10-04 13:58:06
2017-10-04 13:56:210
2017-10-04 13:33:5037
2017-10-04 11:59:0237
2017-10-04 11:55:270
2017-10-04 11:54:49
2017-10-04 11:42:4237
2017-10-04 11:39:000
2017-10-04 11:24:0737
2017-10-04 11:17:1837
2017-10-03 18:06:3137
2017-10-03 18:05:3437
2017-10-03 18:04:2337
2017-10-02 19:44:3237
2017-10-02 19:43:520
2017-10-02 19:43:090
2017-10-02 19:42:1937
2017-10-02 19:39:2137
Task:Kyselyt
Sender:Katajisto
Submission time:2017-10-06 20:29:36
Language:C++
Status:READY
Score:100

Feedback

groupverdictscore
#1ACCEPTED12
#2ACCEPTED25
#3ACCEPTED63

Test results

testverdicttime (s)group
#1ACCEPTED0.05 / 1.001details
#2ACCEPTED0.06 / 1.002details
#3ACCEPTED0.05 / 1.003details

Code

#include <stdint.h>
#include <iostream>
#include <vector>
using namespace std;
const uint64_t kerto[20] = { UINT64_C(1), UINT64_C(10), UINT64_C(100), UINT64_C(1000), UINT64_C(10000), UINT64_C(100000), UINT64_C(1000000), UINT64_C(10000000), UINT64_C(100000000), UINT64_C(1000000000), UINT64_C(10000000000), UINT64_C(100000000000), UINT64_C(1000000000000),UINT64_C(10000000000000), UINT64_C(100000000000000), UINT64_C(1000000000000000), UINT64_C(10000000000000000), UINT64_C(100000000000000000), UINT64_C(1000000000000000000), UINT64_C(10000000000000000000) };
int calc(uint64_t i)
{
	uint64_t     nums = 1U;
	uint64_t     arvo = 1U;
	uint64_t     limit = 9U;
	i--;
	while (i / limit >= nums) {
		const uint64_t vlimit = limit;
		i -= nums * limit;
		nums++;
		arvo *= 10U;
		limit *= 10U;
		if (limit <= vlimit)
			break;
	}
	arvo += i / nums;
	arvo /= kerto[(nums - 1) - (i % nums)];
	return arvo % 10U;
}
int main()
{
	vector<long long> queryvector = {};
	long long int query;
	cin >> query;
	for (long int i = 0; i < query; i++)
	{
		long long int q;
		cin >> q;
		queryvector.push_back(q);
	}
	for (long long kysely : queryvector)
	{
		cout << calc(kysely) << endl;
	}
}

Test details

Test 1

Group: 1

Verdict: ACCEPTED

input
1000
582
214
723
273
480
280
237
204
134
210
565
640
784
508
846
532
465
952
205
...
view   save

correct output
0
1
7
7
6
1
5
4
7
6
2
2
2
2
8
2
1
3
1
8
...
view   save

user output
0
1
7
7
6
1
5
4
7
6
2
2
2
2
8
2
1
3
1
8
...
view   save

Test 2

Group: 2

Verdict: ACCEPTED

input
1000
615664
916441
627600
279508
126605
944125
25887
440405
352957
206746
951305
821686
716797
333476
430123
167570
619834
411383
459670
...
view   save

correct output
1
2
3
2
2
8
7
9
8
3
7
1
9
8
4
3
1
9
9
6
...
view   save

user output
1
2
3
2
2
8
7
9
8
3
7
1
9
8
4
3
1
9
9
6
...
view   save

Test 3

Group: 3

Verdict: ACCEPTED

input
1000
672274832941907421
260504693279721732
646999966092970935
100853063389774434
469646937576313460
292789544562527987
202678876957048242
921044261294332160
293497307441838185
889420403130803486
887773296767104352
272588988734184089
900854413164191389
306838570888252671
321818592757748092
632312861733842235
590425060048634753
921705179835679834
711775852688052272
...
view   save

correct output
7
2
2
0
9
7
7
2
0
4
0
3
0
5
9
9
3
1
2
7
...
view   save

user output
7
2
2
0
9
7
7
2
0
4
0
3
0
5
9
9
3
1
2
7
...
view   save