結果
| 問題 | No.3649 Top View of Jenga |
| コンテスト | |
| ユーザー |
tnakao0123
|
| 提出日時 | 2026-08-29 14:54:10 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| + 430µs | |
| コード長 | 690 bytes |
| 記録 | |
| コンパイル時間 | 172 ms |
| コンパイル使用メモリ | 52,428 KB |
| 実行使用メモリ | 6,272 KB |
| 最終ジャッジ日時 | 2026-08-29 14:54:12 |
| 合計ジャッジ時間 | 1,607 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 20 |
ソースコード
/* -*- coding: utf-8 -*-
*
* 3649.cc: No.3649 Top View of Jenga - yukicoder
*/
#include<cstdio>
#include<algorithm>
using namespace std;
/* constant */
/* typedef */
using ll = long long;
/* global variables */
int cs[3][3];
/* subroutines */
/* main */
int main() {
ll n;
scanf("%lld", &n);
ll q = n / 3, r = n % 3;
if (r > 0) {
if (! (q & 1)) {
for (int i = 0; i < r; i++)
for (int j = 0; j < 3; j++) cs[j][i]++;
}
else {
for (int i = 0; i < r; i++)
for (int j = 0; j < 3; j++) cs[i][j]++;
}
}
for (int i = 0; i < 3; i++)
for (int j = 0; j < 3; j++)
printf("%lld%c", q + cs[i][j], (j < 2) ? ' ' : '\n');
return 0;
}
tnakao0123