Rezultati

Up. imeNalogaJezikRezultatČas oddaje
rektifikatorji-2018 Podnapisi C++ 100/100OK 10. maj '18 @ 18:21

Test Točke Porabljen spomin Porabljen čas Status
#1 7/7 3,621 MiB 0,000 s OK
#2 7/7 3,684 MiB 0,000 s OK
#3 7/7 3,473 MiB 0,003 s OK
#4 7/7 4,402 MiB 0,033 s OK
#5 7/7 3,543 MiB 0,003 s OK
#6 7/7 3,535 MiB 0,004 s OK
#7 7/7 3,543 MiB 0,004 s OK
#8 7/7 3,473 MiB 0,004 s OK
#9 7/7 3,539 MiB 0,000 s OK
#10 7/7 3,871 MiB 0,000 s OK
#11 7/7 3,543 MiB 0,000 s OK
#12 7/7 3,617 MiB 0,000 s OK
#13 8/8 3,684 MiB 0,000 s OK
#14 8/8 3,477 MiB 0,003 s OK

Ocenjevani program (Source (1).cpp):
#include <iostream>
#include <string>
#include <cstdlib>
#include <sstream>
#include <string.h>
#include <cstdio>
#include <cstdio>

using namespace std;
#define uint unsigned int

void zamakni(char st[], char end[], uint n);

int main() {
	string ln;
	getline(cin, ln);
	uint n = 3600000 * ((ln[7] - '0') * 10 + ln[8] - '0') + 60000 * ((ln[10] - '0') * 10 + ln[11] - '0') + 1000 * ((ln[13] - '0') * 10 + ln[14] - '0') + 100*(ln[16] - '0') + 10 * (ln[17] -'0') + ln[18] - '0';

	string lines[10005];
	int index = 0;
	while (getline(cin, lines[index])) {
		++index;
	}
	string start, konec, sep, text, t;
	int num;
	char st[50], ed[50];
	int cnt = 0;
	stringstream ss;
	while (cnt < index) {
		num = atoi(lines[cnt++].c_str());
		ss << lines[cnt++];
		ss >> start >> sep >> konec;
		strcpy(st, start.c_str());
		strcpy(ed, konec.c_str());
		zamakni(st, ed, n);
		text = "";
		t = lines[cnt++];
		while (cnt < index + 1 && t != "") {
			text += "\n";
			text += t;
			t = lines[cnt++];
		}
		cout << num << endl << string(st) << " " << sep << " " << string(ed);
		cout << text << endl;
		
		if(cnt < index)
			cout << endl;
			
		ss.clear();
	}

	//system("pause");

	return 0;
}

void zamakni(char st[], char end[], uint n) {
	uint t = ((st[0] - 48) * 10 + st[1] - 48) * 3600000 + ((st[3] - 48) * 10 + st[4] - 48) * 60000 + ((st[6] - 48) * 10 + st[7] - 48) * 1000 + 100 * (st[9] - '0') + 10 * (st[10] - '0') + st[11] - '0' + n;
	uint h = t / 3600000;
	t -= h * 3600000;
	uint m = t / 60000;
	t -= m * 60000;
	uint s = t / 1000;
	t -= s * 1000;
	uint ms = t;
	sprintf(st, "%02d:%02d:%02d,%03d", h, m, s, ms);

	t = ((end[0] - 48) * 10 + end[1] - 48) * 3600000 + ((end[3] - 48) * 10 + end[4] - 48) * 60000 + ((end[6] - 48) * 10 + end[7] - 48) * 1000 + 100 * (end[9] - '0') + 10 * (end[10] - '0') + end[11] - '0' + n;
	h = t / 3600000;
	t -= h * 3600000;
	m = t / 60000;
	t -= m * 60000;
	s = t / 1000;
	t -= s * 1000;
	ms = t;
	sprintf(end, "%02d:%02d:%02d,%03d", h, m, s, ms);
}