結果
問題 |
No.501 穴と文字列
|
ユーザー |
![]() |
提出日時 | 2025-06-24 21:12:27 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 245 bytes |
コンパイル時間 | 1,904 ms |
コンパイル使用メモリ | 193,024 KB |
実行使用メモリ | 7,848 KB |
最終ジャッジ日時 | 2025-06-24 21:12:31 |
合計ジャッジ時間 | 3,061 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 22 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:6:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 6 | scanf("%lld%lld",&n,&d); | ~~~~~^~~~~~~~~~~~~~~~~~
ソースコード
#include<bits/stdc++.h> #define int long long using namespace std; int n,d; signed main(){ scanf("%lld%lld",&n,&d); while(n){ if(d!=0&&d/n<2)printf("A"),d--; else if(d!=0&&d/n==2)printf("B"),d-=2; else printf("C"); n--; } return 0; }