結果

問題 No.3274 Arithmetic Right Shift
ユーザー The Forsaking
提出日時 2025-09-19 21:25:01
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 8 ms / 1,500 ms
コード長 500 bytes
コンパイル時間 1,626 ms
コンパイル使用メモリ 194,372 KB
実行使用メモリ 7,720 KB
最終ジャッジ日時 2025-09-19 21:25:16
合計ジャッジ時間 2,164 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 5
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:18:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   18 |         scanf("%d%s", &n, s + 1);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

typedef pair<int, int> pii;
typedef long long ll;
typedef pair<ll, ll> pli;
const int N = 2000086, MOD = 1e9 + 7, INF = 0x3f3f3f3f;
ll res;
int n, m, cnt, w[N];


char s[N];
int main() {
    int T;
    cin >> T;
    while (T--) {
        scanf("%d%s", &n, s + 1);
        n = min((int)strlen(s + 1), n);
        for (int i = 1; i < n + 1; i++) putchar(s[1]);
        for (int i = 1; s[i + n]; i++) putchar(s[i]);
        puts("");
    }
    return 0;
}
0