# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
636741 | iee | Titlovi (COCI19_titlovi) | C++17 | 1 ms | 340 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
// iee
#include <bits/stdc++.h>
#define rep(i, a, b) for (int i = (a); i <= (b); ++i)
#define per(i, a, b) for (int i = (a); i >= (b); --i)
#define fi first
#define se second
using ll = long long;
using ull = unsigned long long;
using namespace std;
void work(int);
template <class T> void read(T &x) {
x = 0;
int f = 1, ch = getchar();
while (!isdigit(ch)) {
if (ch == '-') f = -1;
ch = getchar();
}
while (isdigit(ch)) {
x = x * 10 + (ch - '0');
ch = getchar();
}
x *= f;
}
int main() {
int TT = 1; // cin >> TT;
rep(CAS, 1, TT)
work(CAS);
return 0;
}
struct SRT {
int id, tl, tr;
vector<string> nr;
};
SRT Get() {
int id;
scanf("%d", &id);
int tlh, tlm, tls, tlms, tl;
int trh, trm, trs, trms, tr;
scanf("%d:%d:%d,%d --> %d:%d:%d,%d\n", &tlh, &tlm, &tls, &tlms, &trh, &trm, &trs, &trms);
tl = tlh * 1000 * 60 * 60 + tlm * 1000 * 60 + tls * 1000 + tlms;
tr = trh * 1000 * 60 * 60 + trm * 1000 * 60 + trs * 1000 + trms;
vector<string> nr;
string s;
do {
getline(cin, s);
nr.push_back(s);
} while (s.size() != 0 && s != "#");
return (SRT) {id, tl, tr, nr};
}
void print(SRT srt) {
cout << srt.id << endl;
int tl = srt.tl, tr = srt.tr;
int tlh, tlm, tls, tlms;
int trh, trm, trs, trms;
tlms = tl % 1000, tl = (tl - tlms) / 1000;
tls = tl % 60, tl = (tl - tls) / 60;
tlm = tl % 60, tl = (tl - tlm) / 60;
tlh = tl;
trms = tr % 1000, tr = (tr - trms) / 1000;
trs = tr % 60, tr = (tr - trs) / 60;
trm = tr % 60, tr = (tr - trm) / 60;
trh = tr;
printf("%02d:%02d:%02d,%03d --> %02d:%02d:%02d,%03d\n", tlh, tlm, tls, tlms, trh, trm, trs, trms);
for (string it: srt.nr) cout << it << endl;
}
void work(int CASE) {
vector<SRT> srt;
while (1) {
srt.push_back(Get());
if (srt.back().nr.back() == "#") break;
}
int T;
scanf("%d", &T);
for (SRT &it: srt) {
it.tl += T, it.tr += T;
}
for (SRT it: srt)
print(it);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |