結果
| 問題 |
No.8008 某マヨネーズの網目柄
|
| ユーザー |
|
| 提出日時 | 2018-03-06 18:14:09 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 317 bytes |
| コンパイル時間 | 1,531 ms |
| コンパイル使用メモリ | 166,816 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-09-19 19:17:18 |
| 合計ジャッジ時間 | 2,479 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 20 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int GCD( const int X, const int Y )
{
int s;
int t;
s = X;
t = Y;
while( true )
{
s %= t;
if( s == 0 ) return t;
t %= s;
if( t == 0 ) return s;
}
return 0;
}
int main()
{
int N;
int M;
cin >> N;
cin >> M;
cout << GCD( N, M ) << endl;
return 0;
}