結果
問題 |
No.2063 ±2^k operations (easy)
|
ユーザー |
|
提出日時 | 2022-09-02 23:24:13 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 4 ms / 2,000 ms |
コード長 | 348 bytes |
コンパイル時間 | 618 ms |
コンパイル使用メモリ | 66,088 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-16 06:24:18 |
合計ジャッジ時間 | 1,465 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 21 |
コンパイルメッセージ
main.cpp:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 4 | main() | ^~~~
ソースコード
#include<iostream> using namespace std; string N; main() { cin>>N; int cnt=0; for(char c:N)if(c=='1')cnt++; if(cnt==2) { cout<<"Yes"<<endl; return 0; } else if(cnt==1) { cout<<"No"<<endl; return 0; } int i=0; while(N[i]=='0')i++; for(int j=0;j<cnt;j++)if(N[i+j]!='1') { cout<<"No"<<endl; return 0; } cout<<"Yes"<<endl; }