+ Concise, with correct complexity and duplicate handling
- Spaces in reference declarations violate the requested style
SOLVE THE QUESTION IN CPP, USING NAMESPACE STD, IN A SIMPLE BUT HIGHLY EFFICIENT WAY, AND PROVIDE IT WITH THIS RESTYLING: no comments, no space betwee
| Category | Development › Coding |
|---|---|
| Tags | DraftingDeveloperCode |
SOLVE THE QUESTION IN CPP, USING NAMESPACE STD, IN A SIMPLE BUT HIGHLY EFFICIENT WAY, AND PROVIDE IT WITH THIS RESTYLING: no comments, no space between operator and operand but proper margin and indentation, brackets open on the next line always and do not forget to rename variables as short as possible, possibly alphabets
This prompt generates online-assessment solutions in a specific C++ style. It fixes the language to C++ and strongly constrains formatting rather than emphasizing explanation.
ChatGPT is strongest in accuracy and concision. Gemini implements the solution well but misstates complexity, while [C] is missing.
+ Concise, with correct complexity and duplicate handling
- Spaces in reference declarations violate the requested style
+ Closely follows the format and catches the faulty example
- Misstates complexity as O(N+K) and invents a runtime estimate
| Criterion | ChatGPT | Gemini | Leader |
|---|---|---|---|
| Instruction following | 8 | 9 | Gemini +13% |
| Accuracy | 9 | 7 | ChatGPT +29% |
| Specificity | 9 | 9 | Tie |
| Structure | 9 | 8 | ChatGPT +13% |
| Right length | 10 | 7 | ChatGPT +43% |
Scored 1–10 by gpt-5.6-sol with model names hidden (2026-09-24). This is an AI review, not a measurement.
We gave three models the same input and copied their answers unedited. Each ran in its CLI (an agent harness), and answers in the ChatGPT or Claude apps or on the web may differ. Outputs are in Korean.
[Pasted material] 문제: 정수 배열 nums(길이 최대 100,000)와 정수 target이 주어진다. nums에서 두 원소의 합이 target이 되는 인덱스 쌍 (i, j)를 i < j 조건으로 모두 찾아, i 기준 오름차순으로 정렬된 2차원 벡터로 반환하라. 시간 제한 2초, 메모리 제한 256MB. 예시: nums = [2,7,11,15,3,6,9], target = 9 이면 결과는 [[0,1],[2,5]] 이다. 같은 값이 여러 번 나올 수 있으며, 하나의 인덱스는 여러 쌍에 중복 사용될 수 있다.
#include <bits/stdc++.h>
using namespace std;
vector<vector<int>> f(vector<int>& a,int t)
{
unordered_map<int,vector<int>> m;
vector<vector<int>> r;
for(int i=0;i<a.size();i++)
{
m[a[i]].push_back(i);
}
for(int i=0;i<a.size();i++)
{
auto it=m.find(t-a[i]);
if(it==m.end())
{
continue;
}
auto& v=it->second;
auto p=lower_bound(v.begin(),v.end(),i+1);
for(;p!=v.end();p++)
{
r.push_back({i,*p});
}
}
return r;
}
각 인덱스 i를 기준으로 i보다 큰 보완값의 인덱스를 찾아 결과에 추가합니다. 인덱스를 앞에서부터 처리하므로 결과는 i 기준 오름차순이며, 시간 복잡도는 O(n log n+k), 공간 복잡도는 O(n+k)입니다. 여기서 k는 결과 쌍의 개수입니다.
예시의 올바른 결과는 [[0,1],[4,5]]입니다.
| 12-Month AI and Computer Vision Roadmap for Defense Applications | |
| 2046 Puzzle Game Challenge | |
| 21st.dev component prompt | |
| 3D FACTORY | |
| 3D FPS Game |