結果
| 問題 |
No.546 オンリー・ワン
|
| コンテスト | |
| ユーザー |
vjudge1
|
| 提出日時 | 2025-05-18 22:19:15 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 400 bytes |
| コンパイル時間 | 1,910 ms |
| コンパイル使用メモリ | 190,420 KB |
| 実行使用メモリ | 9,600 KB |
| 最終ジャッジ日時 | 2025-05-18 22:19:21 |
| 合計ジャッジ時間 | 5,683 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 TLE * 1 -- * 1 |
| other | -- * 7 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:9:35: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
9 | for(int i=1;i<=n;i++)scanf("%lld",&c[i]);
| ~~~~~^~~~~~~~~~~~~~
ソースコード
#include<bits/stdc++.h>
#define int long long
using namespace std;
int n,l,r,c[1234567],ans;
signed main(){
// freopen("onlyone.in","r",stdin);
// freopen("onlyone.out","w",stdout);
cin>>n>>l>>r;
for(int i=1;i<=n;i++)scanf("%lld",&c[i]);
for(int i=l;i<=r;i++){
int cnt=0;
for(int j=1;j<=n;j++){
if(i%c[j]==0)cnt++;
if(cnt>1)break;
}
if(cnt==1)ans++;
}
cout<<ans<<endl;
return 0;
}
vjudge1