結果
| 問題 |
No.721 Die tertia (ディエ・テルツィア)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-09-10 10:18:39 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 2,000 ms |
| コード長 | 760 bytes |
| コンパイル時間 | 1,541 ms |
| コンパイル使用メモリ | 167,044 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-02 16:14:41 |
| 合計ジャッジ時間 | 2,411 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 18 |
ソースコード
/**
@file 721.cpp
@title No.721 Die tertia (ディエ・テルツィア) - yukicoder
@url https://yukicoder.me/problems/no/721
**/
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
#define ALL(obj) (obj).begin(), (obj).end()
#define REP(i, N) for (int i = 0; i < (N); ++i)
int main() {
string S;
cin >> S;
int year = stoi(S.substr(0, 4));
int mon = stoi(S.substr(5, 2));
int day = stoi(S.substr(8, 2));
// cout << year << "/" << mon << "/" << day << endl;
struct tm ymd = {0, 0, 0, day, mon - 1, year - 1900};
time_t now = mktime(&ymd);
now += 2 * 24 * 60 * 60;
struct tm* ymd_2d = localtime(&now);
char ans[81];
strftime(ans, sizeof(ans), "%Y/%m/%d", ymd_2d);
cout << ans << endl;
return 0;
}