# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
845177 | vjudge1 | Datum (COCI20_datum) | C++14 | 284 ms | 528 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
vector<int> lens = {-1, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
void solve(void){
string s;
cin >> s;
int m, d, y;
d = (s[0]-'0')*10 + s[1]-'0';
m = (s[3]-'0')*10 + s[4]-'0';
y = ( (s[6]-'0')*10 + s[7]-'0' )*100 + (s[8]-'0')*10 + s[9]-'0';
vector<vector<int>> pal;
for(int month = 1; month<=12; month++){
for(int day=1; day<=lens[month]; day++){
int year = ( (day/10) + (day%10)*10 + (month/10)*100 + (month%10)*1000 );
pal.push_back({year, month, day});
}
}
sort(pal.begin(), pal.end());
vector<int> bruh = {y, m, d};
for(int i=0; i<pal.size(); i++){
if( bruh < pal[i] ){
printf("%.2d.%.2d.%.4d.\n", pal[i][2], pal[i][1], pal[i][0]);
break;
}
}
}
int main(){
int t=1;
cin >> t;
while(t--)
solve();
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |