Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|---|
2742 | A班-岑思熠 | 1加到多少才超过N | C++ | Accepted | 100 | 3 MS | 256 KB | 186 | 2024-12-21 11:28:56 |
#include<bits/stdc++.h> using namespace std; int main() { int n,sum=0; cin>>n; for(int i=1;;i++) { sum+=i; if(sum>n) { cout<<i; break; } } return 0; }