結果

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

ソースコード

diff #
raw source code

#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
using ll = long long;

ll ans[3][3];
int main(void){
  ll n; cin >> n;
  ll r=n%3, x=n/3;
  for(int i=0; i<3; i++)for(int j=0; j<3; j++) ans[i][j]=x;
  if(x&1) for(int j=0; j<3; j++)for(int i=0; i<r; i++) ans[i][j]++;
  else  for(int i=0; i<3; i++)for(int j=0; j<r; j++) ans[i][j]++;
  for(int i=0; i<3; i++)for(int j=0; j<3; j++) cout << ans[i][j] << (j==2?'\n':' ');
  return 0; 
}
0