結果
| 問題 |
No.3054 Modulo Inequalities
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-01-18 16:24:22 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 753 bytes |
| コンパイル時間 | 1,046 ms |
| コンパイル使用メモリ | 96,524 KB |
| 実行使用メモリ | 20,924 KB |
| 最終ジャッジ日時 | 2025-02-02 13:31:32 |
| 合計ジャッジ時間 | 85,261 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 8 TLE * 23 |
ソースコード
// TLE
// #pragma GCC target("avx2") // Compile Error?
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <cmath>
#include <iostream>
#include <vector>
constexpr int M = 1000010;
int main() {
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
int n;
std::cin >> n;
std::vector<std::pair<int, int>> ps(n);
for (auto &[a, b] : ps) {
std::cin >> a >> b;
}
int max_num = -1;
int argmax = -1;
for (int mod = 1; mod <= M; ++mod) {
int num = 0;
for (const auto &[a, b] : ps) {
num += (a % mod) < (b % mod);
}
if (num > max_num) {
max_num = num;
argmax = mod;
}
}
std::cout << argmax << '\n';
}