結果
問題 |
No.756 チャンパーノウン定数 (1)
|
ユーザー |
![]() |
提出日時 | 2019-03-28 02:49:00 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 288 bytes |
コンパイル時間 | 486 ms |
コンパイル使用メモリ | 57,636 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-11 19:01:05 |
合計ジャッジ時間 | 1,481 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 1 |
other | AC * 16 WA * 4 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:15:11: warning: ‘ans’ may be used uninitialized in this function [-Wmaybe-uninitialized] 15 | cout<<ans<<endl; | ^~~
ソースコード
#include <iostream> #include <string> #include <algorithm> using namespace std; int main(void){ int a,b,ans; cin>>a; if(a<=9){ cout<<a<<endl; }else if(a%2==1){ ans=((a-10)/2+10)%10; }else{ ans=((a-10)/2+10)/10; } cout<<ans<<endl; }