結果
| 問題 |
No.2117 中国剰余定理入門
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-11-04 21:21:50 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 259 bytes |
| コンパイル時間 | 448 ms |
| コンパイル使用メモリ | 65,036 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-18 19:03:43 |
| 合計ジャッジ時間 | 1,065 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 |
コンパイルメッセージ
main.cpp:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
4 | main()
| ^~~~
ソースコード
#include<iostream>
using namespace std;
int B[2],C[2];
main()
{
for(int i=0;i<2;i++)cin>>C[i]>>B[i],B[i]=(B[i]%C[i]+C[i])%C[i];
for(int n=0;n<C[0]*C[1];n++)
{
if(n%C[0]==B[0]&&n%C[1]==B[1])
{
cout<<n<<endl;
return 0;
}
}
cout<<"NaN"<<endl;
}