結果
問題 | No.501 穴と文字列 |
ユーザー |
![]() |
提出日時 | 2017-07-25 22:40:31 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 405 bytes |
コンパイル時間 | 1,239 ms |
コンパイル使用メモリ | 157,248 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-14 16:41:44 |
合計ジャッジ時間 | 2,053 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 22 |
コンパイルメッセージ
main.cpp:2:1: warning: ISO C++ forbids declaration of ‘main’ with no type [-Wreturn-type] 2 | main(){ | ^~~~ main.cpp: In function ‘int main()’: main.cpp:4:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 4 | scanf("%d%d",&N,&D); | ~~~~~^~~~~~~~~~~~~~
ソースコード
#include<bits/stdc++.h> main(){ int N,D; scanf("%d%d",&N,&D); if(N>=D){ for(int i = 0;i < D;i++){ printf("A"); } for(int i = 0;i < N-D;i++){ printf("C"); } }else{ for(int i = 0;i < 2*N-D;i++){ printf("A"); } for(int i = 0;i < D-N;i++){ printf("B"); } } printf("\n"); }