結果
| 問題 | No.3718 XOR Escape |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-09-18 22:31:01 |
| 言語 | C++23 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 1 ms / 2,000 ms |
| + 342µs | |
| コード長 | 808 bytes |
| 記録 | |
| コンパイル時間 | 2,229 ms |
| コンパイル使用メモリ | 337,236 KB |
| 実行使用メモリ | 6,528 KB |
| 最終ジャッジ日時 | 2026-09-18 22:31:06 |
| 合計ジャッジ時間 | 3,496 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 18 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
ll N,A,B,C;
cin>>N>>A>>B>>C;
vector<ll> W={A,B,C};
sort(W.begin(),W.end());
if(W[0]!=1){
ll an=N;
for(int i=0;i<3;i++){
if(__builtin_popcountll(W[i]+1)==1){
ll p=(W[i]+1)/2;
an-=(N+p)/(W[i]+1);
}
}
cout<<an<<"\n";
}
else{
if(W[2]==3){
cout<<N/4<<"\n";
}
else {
ll an=N/2;
for(int i=1;i<2;i++){
if(__builtin_popcountll(W[i]+2)==1){
ll p=(W[i]+2)/2;
an-=(N+p)/(W[i]+2);
}
}
cout<<an<<"\n";
}
}
}