結果

問題 No.3649 Top View of Jenga
コンテスト
ユーザー tau1235
提出日時 2026-08-28 21:29:05
言語 C++23
(gcc 15.2.0 + boost 1.90.0)
コンパイル:
g++-15 -O2 -lm -std=c++23 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 1 ms / 2,000 ms
+ 560µs
コード長 526 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,639 ms
コンパイル使用メモリ 335,820 KB
実行使用メモリ 6,272 KB
最終ジャッジ日時 2026-08-28 21:29:27
合計ジャッジ時間 3,633 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include<bits/stdc++.h>
using namespace std;

int main(){
  using ll=long long;
  ll n;
  cin>>n;
  vector<vector<ll>> ans(3,vector<ll>(3,n/6*2));
  n%=6;
  if (n>=1) ans[0][0]++,ans[1][0]++,ans[2][0]++;
  if (n>=2) ans[0][1]++,ans[1][1]++,ans[2][1]++;
  if (n>=3) ans[0][2]++,ans[1][2]++,ans[2][2]++;
  if (n>=4) ans[0][0]++,ans[0][1]++,ans[0][2]++;
  if (n>=5) ans[1][0]++,ans[1][1]++,ans[1][2]++;
  if (n>=6) ans[2][0]++,ans[2][1]++,ans[2][2]++;
  for (int i=0;i<3;i++) for (int j=0;j<3;j++) cout<<ans[i][j]<<" \n"[j==2];
}
0