# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
482187 | rainboy | Datum (COCI20_datum) | C11 | 32 ms | 536 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.
#include <stdio.h>
int days[] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
int main() {
int t;
scanf("%d", &t);
while (t--) {
int d, m, y, y_;
scanf("%d.%d.%d.", &d, &m, &y);
for (y_ = y; ; y_ = (y_ + 1) % 10000) {
int d_ = (y_ % 10) * 10 + (y_ / 10 % 10);
int m_ = (y_ / 100 % 10) * 10 + (y_ / 1000);
if (m_ >= 1 && m_ <= 12
&& d_ >= 1 && d_ <= days[m_] + (m_ == 2 && y_ % 4 == 0 ? 1 : 0)
&& (y_ != y || m_ > m || m_ == m && d_ > d)) {
printf("%02d.%02d.%04d.\n", d_, m_, y_);
break;
}
}
}
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |