結果
問題 | No.964 2020 |
ユーザー |
|
提出日時 | 2020-01-13 20:23:19 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,020 ms |
コード長 | 518 bytes |
コンパイル時間 | 2,276 ms |
コンパイル使用メモリ | 194,220 KB |
最終ジャッジ日時 | 2025-01-08 17:27:21 |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 8 |
コンパイルメッセージ
main.cpp: In function ‘void solve()’: main.cpp:8:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 8 | scanf("%d", &n); | ~~~~~^~~~~~~~~~
ソースコード
#include <bits/stdc++.h>using i64 = int_fast64_t;#define repeat(i, a, b) for(int i = (a); (i) < (b); ++(i))#define rep(i, n) repeat(i, 0, n)void solve() {int n;scanf("%d", &n);std::string s;if(n == 1) {std::cout << 1 << std::endl;return;}for(int i = n - 1; i >= 0; i--) {rep(_, n) s += std::to_string(i);}std::cout << s << std::endl;}int main() {// std::ios::sync_with_stdio(false);std::cin.tie(nullptr);solve();return 0;}