結果
問題 |
No.501 穴と文字列
|
ユーザー |
|
提出日時 | 2018-07-25 02:46:15 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 307 bytes |
コンパイル時間 | 145 ms |
コンパイル使用メモリ | 23,040 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-24 09:46:26 |
合計ジャッジ時間 | 1,101 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 22 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:5:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 5 | scanf("%d %d",&N,&D); | ~~~~~^~~~~~~~~~~~~~~
ソースコード
#include<cstdio> using namespace std; int main(void){ int N,D,i; scanf("%d %d",&N,&D); if(N<=D){ for(i=0;i<2*N-D;i++){ printf("A"); } for(i=0;i<D-N;i++){ printf("B"); } } else{ for(i=0;i<D;i++){ printf("A"); } for(i=0;i<N-D;i++){ printf("C"); } } printf("\n"); return 0; }